- 博客(2)
- 收藏
- 关注
原创 [笔试练习]
1.在一组数的编码中,若任意两个相邻的代码只有一位二进制数不同, 则称这种编码为格雷码(Gray Code),请编写一个函数,使用递归的方法生成N位的格雷码。给定一个整数n,请返回n位的格雷码,顺序为从0开始。测试样例:1返回:["0","1"]代码:class GrayCode {public: vector getGray(int n)
2016-09-11 10:56:21 371
原创 [leetcode]139. Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"
2016-09-09 16:22:24 354
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人