A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message con... Read More
Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order... Read More
Reverse a linked list from position m to n. Do it in-place and in one-pass.For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->... Read More
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... Read More
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... Read More
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example, [1,1,2] have the following unique pe... Read More
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic... Read More
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers.... Read More
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ... Read More
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example, Given n = 3, your program should return all... Read More