Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below a... Read More
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example, Given n = 3, there are a total of 5 unique BST'... Read More
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... Read More
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr... Read More
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space (size that is greater or equa... Read More
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for... Read More
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.说明:平衡二叉搜索树,即任何结点的左子树和右子树高度最多相差1的二叉搜索树。二叉搜索树:二叉查找树(Bin... Read More
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... Read More
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... Read More