Home
Gaurav's GitHub Page
Cancel

Remove Consecutive Characters (InterviewBit)

PROBLEM DESCRIPTION Given a string A and integer B, remove all consecutive same characters that have length exactly B. NOTE : All the consecutive same characters that have length exactly B will b...

Implement StrStr (InterviewBit)

PROBLEM DESCRIPTION Implement strStr(). strstr - locate a substring ( needle ) in a string ( haystack ). Try not to use standard library string functions for this question. Returns the index of...

Divide Integers (InterviewBit)

PROBLEM DESCRIPTION Divide two integers A and B, without using multiplication, division, and mod operator. Return the floor of the result of the division.Also, consider if there can be overflow c...

Bulls and Cows (InterviewBit)

PROBLEM DESCRIPTION You are playing the Bulls and Cows game with your friend. You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you p...

Amazing Subarrays (InterviewBit)

PROBLEM DESCRIPTION You are given a string A, and you have to find all the amazing substrings of A. An amazing Substring is one that starts with a vowel (a, e, i, o, u, A, E, I, O, U). Note: Take...

Longest Common Prefix (InterviewBit)

PROBLEM DESCRIPTION Given the array of strings A, you need to find the longest string S which is the prefix of ALL the strings in the array. Longest common prefix for a pair of strings S1 and S2 ...

Self Permutation (InterviewBit)

PROBLEM DESCRIPTION You are given two strings A and B. Check whether there exists any permutation of both A and B such that they are equal. Return a single integer 1 if its exists, 0 otherwise. ...

String And Its Frequency (InterviewBit)

PROBLEM DESCRIPTION Given a string A with lowercase english alphabets and you have to return a string in which, with each character its frequency is written in adjacent. SOLUTION public class So...

Deserialize (InterviewBit)

PROBLEM DESCRIPTION You are given a string A which is a serialized string. You have to restore the original array of strings. The string in the output array should only have lowercase english alp...

Different Bits Sum Pairwise (InterviewBit)

PROBLEM DESCRIPTION We define f(X, Y) as the number of different corresponding bits in the binary representation of X and Y. For example, f(2, 7) = 2, since the binary representation of 2 and 7 a...