Find the maximum occurring word in a given set of strings
Given a huge set of words with duplicates present, find the maximum occurring word in it. If two words have the same count, return any one of them.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a huge set of words with duplicates present, find the maximum occurring word in it. If two words have the same count, return any one of them.
Lexicographic sorting: Given a set of strings, print them in lexicographic order (dictionary/alphabetical order).
Given a dictionary of words, determine if a given string can be segmented into a space-separated sequence of one or more dictionary words.
Given a string and a pattern containing wildcard characters, i.e., * and ?’, where ? can match to any single character in the string and * can match to any number of characters including zero characters, design an efficient algorithm to find if the pattern matches with the complete string or not.
This post discusses std::prev_permutation, which can be used to find the lexicographically smaller permutations of a string.
Generate all permutations of a string in Java.
Given a sequence consisting of I and D, where I denotes the increasing sequence and D denotes the decreasing sequence, decode the sequence to construct a minimum number without repeated digits.
This post discusses std::next_permutation, which can be used to find the lexicographically greater permutations of a string.
Given a device having left, right, top, and bottom buttons and an OK button to enter a text from a virtual keypad having alphabets from A–Y arranged in a 5 × 5 grid. Find the shortest route in the device to construct a given string if we start from the top-left position in the keypad.
Given a set of positive numbers, find all possible combinations of words formed by replacing the continuous digits with the English alphabet’s corresponding character.
Given a string and a dictionary of words, determine if the string can be segmented into a space-separated sequence of one or more dictionary words.
Given a string, count the number of times a given pattern appears in it as a subsequence.