Count decodings of a given sequence of digits
Given a positive number, map its digits to the corresponding alphabet in the mapping table, and return the count of the total number of decodings possible.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a positive number, map its digits to the corresponding alphabet in the mapping table, and return the count of the total number of decodings possible.
Given an integer array, determine if it can be divided into pairs such that the sum of elements in each pair is divisible by a given integer k.
Given a binary tree, perform the boundary traversal of it. The solution should print the boundary nodes starting from the root of the tree, in an anti-clockwise direction, without any duplicates.
Given an integer array, find the previous smaller element for every array element. The previous smaller element of a number x is the first smaller number to the left of x in the array.
Given an infinite stream of integers, return the element representing the k’th largest element in the stream.
Write an efficient algorithm to fix the children-sum property in a given binary tree. The only operation allowed is an increment operation on the node’s value.
Given an array of words where no word is the prefix of another, find the shortest unique prefix to identify each word in the array uniquely.
Given a binary tree, extract all its leaves into a doubly-linked list, i.e., remove all leaf nodes from the binary tree and construct a doubly linked list out of them.
Given a circularly sorted integer array, find a pair with a given sum. Assume there are no duplicates in the array, and the rotation is in an anti-clockwise direction around an unknown pivot.
Given two linked lists, where the tail of the second list points to a node in the first list, find the node where both lists intersect.
Given a string and a positive integer k, find all distinct substrings of any length containing exactly k distinct characters.
Given an integer array, find the next greater element for every array element. The next greater element of a number x is the first greater number to the right of x in the array.