Beautiful Binary String HackerRank Solution in C, C++, Java, Python
Alice has a binary string. She thinks a binary string is beautiful if and only if it doesn’t contain the substring “010”. In one step, Alice can change a 0 …
Alice has a binary string. She thinks a binary string is beautiful if and only if it doesn’t contain the substring “010”. In one step, Alice can change a 0 …
Use the counting sort to order a list of strings associated with integers. If two strings are associated with the same integer, they must be printed in their original order, …
A numeric string,s , is beautiful if it can be split into a sequence of two or more positive integers,a[1],a[2],…,a[n], , satisfying the following conditions: a[i]-a[i-1]=1 for any 1<i<=n (i.e., …
You are given a string containing characters A and B only. Your task is to change it into a string such that there are no matching adjacent characters. To do …
There is a collection of rocks where each rock has various minerals embeded in it. Each type of mineral is designated by a lowercase letter in the range ascii[a-z]. There …
Comparison Sorting Quicksort usually has a running time of n*log(n), but is there an algorithm that can sort even faster? In general, this is not possible. Most sorting algorithms are …
In this challenge, you will determine whether a string is funny or not. To determine whether a string is funny, create a copy of the string in reverse e.g.abc->cba . …
A weighted string is a string of lowercase English letters where each letter has a weight. Character weights are 1 to 26 from a to z as shown below: The …
A pangram is a string that contains every letter of the alphabet. Given a sentence determine whether it is a pangram in the English alphabet. Ignore case. Return either pangram …
The previous challenges covered Insertion Sort, which is a simple and intuitive sorting algorithm with a running time of O(n^2). In these next few challenges, we’re covering a divide-and-conquer algorithm …