Find all n-digit binary numbers having more 1’s than 0’s for any prefix
Given a positive integer n, find all n–digit binary numbers having more 1’s than 0’s for any prefix of the number.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a positive integer n, find all n–digit binary numbers having more 1’s than 0’s for any prefix of the number.
Given three strings, return true if the third string is interleaving the first and second strings, i.e., it is formed from all characters of the first and second string, and the order of characters is preserved.
Find all n–digit numbers with an equal sum where n varies from 1 to 9 and sum <= 81 (Maximum possible sum in a 9–digit number).
Implement your diff utility, i.e., given two similar strings, efficiently list out all differences between them. The diff utility is a data comparison tool that calculates and displays the differences between the two texts.
Given a string, calculate its rank among all its lexicographically sorted permutations.
Given a string and a pattern (having all distinct characters), determine if the string characters follow a specific order as defined by the pattern’s characters.
Given a string, remove adjacent duplicates characters from it. In other words, remove all consecutive same characters except one.
Given a string and a pattern, determine if the pattern matches with the string or not. The solution should not use any regex.
Write an efficient algorithm to check if a given string is k–palindrome or not. A string is k–palindrome if it becomes a palindrome on removing at most k characters from it.
The KMP Algorithm (or Knuth, Morris, and Pratt string searching algorithm) cleverly uses the previous comparison data. It can search for a pattern in linear time as it never re-compares a text symbol that has matched a pattern symbol.
Given a string, break it into all possible combinations of non-overlapping substrings enclosed within curly brackets.
Given a positive integer, find the minimum number possible by doing at-most k swap operations upon its digits.