摘要: Implement int sqrt(int x). Compute and return the square root of x. Example sqrt(3) = 1 sqrt(4) = 2 sqrt(5) = 2 sqrt(10) = 3 sqrt(3) = 1 sqrt(4) = 2 s 阅读全文
posted @ 2017-09-26 13:14 jasminemzy 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array, return [-1 阅读全文
posted @ 2017-09-26 07:57 jasminemzy 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div 阅读全文
posted @ 2017-09-26 07:18 jasminemzy 阅读(178) 评论(0) 推荐(0) 编辑
摘要: For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. If the target number 阅读全文
posted @ 2017-09-26 03:24 jasminemzy 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a target number, a non-negative integer k and an integer array A sorted in ascending order, find the k closest numbers to target in A, sorted in 阅读全文
posted @ 2017-09-26 03:19 jasminemzy 阅读(181) 评论(0) 推荐(0) 编辑