Find all n-digit numbers with equal sum of digits at even and odd indices
Find all n–digit numbers with an equal sum of digits at even and odd index, where n varies from 1 to 9.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedFind all n–digit numbers with an equal sum of digits at even and odd index, where n varies from 1 to 9.
Write an efficient algorithm to construct the longest palindrome by shuffling or deleting characters from a given string.
Given a string and a pattern, in-place replace all non-overlapping occurrences of the pattern in the string by a specified character.
Given a string, find the first non-repeating character in it by doing only one traversal of it.
Given a string, remove all adjacent duplicates from it. The algorithm should continue removing adjacent duplicates from the string till no duplicate is present in the result.
Given an expression consisting of an opening brace { and a closing brace }, find the minimum number of inversions needed to balance the expression.
Given n lists of words, print all combinations of phrases that can be formed by picking one word from each list.
Write an efficient algorithm to find the longest common prefix (LCP) between a given set of strings.
Given two strings, determine if the first string can be transformed into the second string. The only operation allowed is moving a character from the first string to the front. If the string can be transformed, find the minimum number of operations required for the transformation.
Given a string and a pattern containing wildcard characters, write an efficient algorithm to check if the string matches with the wildcard pattern or not.
Given a string consisting of opening and closing parenthesis, find the length of the longest balanced parenthesis in it.
Given two strings, determine if the first string can be transformed into the second string with a single edit operation. An edit operation can insert, remove, or replace a character in the first string.