摘要: 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 阅读全文
posted @ 2017-01-04 12:42 SillyVicky 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Problem: Count the number of prime numbers less than a non-negative number, n. Summary: 判断小于某非负数n的质数个数。 Solution: 用所谓的“刷质数表”的方式先用HashTable记录小于n的所有数是质数 阅读全文
posted @ 2017-01-04 10:00 SillyVicky 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-04 08:54 SillyVicky 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2017-01-03 13:03 SillyVicky 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-03 08:11 SillyVicky 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-03 07:07 SillyVicky 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-02 13:29 SillyVicky 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-02 11:24 SillyVicky 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-01 13:18 SillyVicky 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-01-01 11:17 SillyVicky 阅读(114) 评论(0) 推荐(0) 编辑