摘要:
题目Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process...
阅读全文
posted @ 2015-12-02 15:06
Coding菌
阅读(159)
推荐(0)
摘要:
题目Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the tw...
阅读全文
posted @ 2015-12-02 14:41
Coding菌
阅读(110)
推荐(0)
摘要:
题目Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.For example, Given nums ...
阅读全文
posted @ 2015-11-30 13:46
Coding菌
阅读(126)
推荐(0)
摘要:
题目Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?分析同LeetCode(274)H-Index第...
阅读全文
posted @ 2015-11-30 13:28
Coding菌
阅读(101)
推荐(0)
摘要:
题目Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index...
阅读全文
posted @ 2015-11-30 13:22
Coding菌
阅读(630)
推荐(0)
摘要:
题目Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.For example, given...
阅读全文
posted @ 2015-11-29 14:50
Coding菌
阅读(163)
推荐(0)
摘要:
题目You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails th...
阅读全文
posted @ 2015-11-29 13:52
Coding菌
阅读(130)
推荐(0)
摘要:
题目According to the Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathemat...
阅读全文
posted @ 2015-11-27 16:47
Coding菌
阅读(218)
推荐(0)
摘要:
题目You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove ...
阅读全文
posted @ 2015-11-27 15:58
Coding菌
阅读(130)
推荐(0)
摘要:
题目Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operat...
阅读全文
posted @ 2015-11-26 14:02
Coding菌
阅读(144)
推荐(0)