摘要:
Given a range [m, n] where 0 >1;10 n=n>>1;11 p++;12 }13 14 return m<<p;15 }16 }; 阅读全文
摘要:
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... 阅读全文
摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol... 阅读全文
摘要:
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with... 阅读全文
摘要:
Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2. After remov... 阅读全文
摘要:
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o... 阅读全文
摘要:
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 class Solution { 2 public: 3 int l... 阅读全文
摘要:
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
摘要:
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off ... 阅读全文