上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
摘要: 解法一: 一个几乎纯数学的解法 numbers: 1,...,9, 10, ..., 99, 100, ... 999, 1000 ,..., 9999, ... # of digits: 9 + 90*2 + 900*3 + 9000*4 + ... 利用这个公式可以很容易的求出来Nth digi 阅读全文
posted @ 2016-12-25 15:25 lettuan 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l 阅读全文
posted @ 2016-12-25 14:13 lettuan 阅读(267) 评论(0) 推荐(0) 编辑
摘要: There is a list of sorted integers from 1 to n. Starting from left to right, remove the first number and every other number afterward until you reach 阅读全文
posted @ 2016-12-25 07:53 lettuan 阅读(742) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. Follow up:Wha 阅读全文
posted @ 2016-12-25 04:15 lettuan 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-12-24 06:09 lettuan 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文
posted @ 2016-12-24 05:44 lettuan 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
posted @ 2016-12-24 04:26 lettuan 阅读(164) 评论(0) 推荐(0) 编辑
摘要: A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The 阅读全文
posted @ 2016-12-24 03:38 lettuan 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-12-24 01:42 lettuan 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-12-23 15:10 lettuan 阅读(202) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页