摘要: Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer 阅读全文
posted @ 2018-10-09 10:31 bernieloveslife 阅读(169) 评论(0) 推荐(0)
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2018-10-09 10:31 bernieloveslife 阅读(141) 评论(0) 推荐(0)
摘要: There is an m by n grid with a ball. Given the start coordinate (i,j) of the ball, you can move the ball to adjacent cell or cross the grid boundary i 阅读全文
posted @ 2018-10-09 10:31 bernieloveslife 阅读(126) 评论(0) 推荐(0)
摘要: Given a n ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2018-10-09 10:31 bernieloveslife 阅读(90) 评论(0) 推荐(0)
摘要: Given an array, rotate the array to the right by k steps, where k is non negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] 阅读全文
posted @ 2018-10-09 10:31 bernieloveslife 阅读(103) 评论(0) 推荐(0)