摘要:
You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. 阅读全文
摘要:
Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
摘要:
Given an array nums of 0s and 1s and an integer k, return True if all 1's are at least k places away from each other, otherwise return False. Example 阅读全文
摘要:
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, 阅读全文
摘要:
Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is po 阅读全文
摘要:
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
摘要:
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
摘要:
In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. If the town judge exists, th 阅读全文
摘要:
Given an array of integers arr. We want to select three indices i, j and k where (0 <= i < j <= k < arr.length). Let's define a and b as follows: a = 阅读全文
摘要:
Given an array target and an integer n. In each iteration, you will read a number from list = {1,2,3..., n}. Build the target array using the followin 阅读全文