01 2017 档案
摘要:Problem: Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not pri
阅读全文
摘要:Problem: Count the number of prime numbers less than a non-negative number, n. Summary: 判断小于某非负数n的质数个数。 Solution: 用所谓的“刷质数表”的方式先用HashTable记录小于n的所有数是质数
阅读全文
摘要:Problem: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All
阅读全文
摘要:Problem: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is.
阅读全文
摘要:Problem: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection betwee
阅读全文
摘要:Problem: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are f
阅读全文
摘要:Problem: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't on
阅读全文
摘要:Problem: A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return
阅读全文
摘要:Problem: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The
阅读全文
摘要:Problem: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along i
阅读全文
摘要:Problem: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant d
阅读全文

浙公网安备 33010602011771号