Fork me on GitHub
摘要: Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexi 阅读全文
posted @ 2017-06-04 18:59 hellowOOOrld 阅读(114) 评论(0) 推荐(0) 编辑
摘要: You may assume no duplicates in the array. Here are few examples. [1,3,5,6], 5 → 2 [1,3,5,6], 2 → 1 [1,3,5,6], 7 → 4 [1,3,5,6], 0 → 0 阅读全文
posted @ 2017-06-04 16:17 hellowOOOrld 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2017-06-04 14:29 hellowOOOrld 阅读(151) 评论(0) 推荐(0) 编辑
摘要: You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2017-06-04 11:52 hellowOOOrld 阅读(274) 评论(0) 推荐(0) 编辑
摘要: Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
posted @ 2017-06-04 11:48 hellowOOOrld 阅读(352) 评论(0) 推荐(0) 编辑