摘要: There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2016-08-13 12:31 fenshen371 阅读(199) 评论(0) 推荐(0)
摘要: An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: a) it --> it (no abbrev 阅读全文
posted @ 2016-08-13 12:02 fenshen371 阅读(205) 评论(0) 推荐(0)
摘要: Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example, 阅读全文
posted @ 2016-08-13 10:56 fenshen371 阅读(136) 评论(0) 推荐(0)
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number i 阅读全文
posted @ 2016-08-13 10:40 fenshen371 阅读(128) 评论(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-08-13 10:18 fenshen371 阅读(138) 评论(0) 推荐(0)