Find length of the longest palindrome possible from a string
Given a string, find the length of the longest palindrome possible from its characters.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a string, find the length of the longest palindrome possible from its characters.
Given a binary tree and an integer k, count the total number of paths in the tree whose sum of all nodes is equal to k.
Given two strings, check if the second string can be constructed from characters of the first string, where each character of the first string can be used only once in the second string.
Given an unsorted integer array, find the smallest missing positive integer in it.
Given a linked list containing a loop, remove the loop from it.
Given a list of departure and arrival airports, find the itinerary in order. It may be assumed that departure is scheduled from every airport except the final destination, and each airport is visited only once.
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 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 length of the longest subsequence formed by the consecutive integers. The subsequence should contain all distinct values, and the character set should be consecutive, irrespective of its order.
Given an array and a positive number k, check whether the array contains any duplicate elements within the range k. If k is more than the array’s size, the solution should check for duplicates in the complete array.
Write an efficient algorithm to construct a binary tree from given inorder and level-order sequence.