摘要: 题目描述: Implement regular expression matching with support for '.' and '*'. 解题思路: 这道题如果只考虑“.”的话其实很好完成,所以解题的关键在于处理“*”的情况。以为“*”与前一个字母有关,所以应该整体考虑ch*……的情况。c 阅读全文
posted @ 2016-06-14 01:31 godlei 阅读(212) 评论(0) 推荐(0)
摘要: 在项目中,我们经常需要把接收到的字符串转换成对应的集合类保存,或者把集合类转换成字符串以方便传输,这个工具类中封装了几个常用的方法,对于这种转换需求十分方便。 阅读全文
posted @ 2016-06-13 22:28 godlei 阅读(3822) 评论(0) 推荐(0)
摘要: 这是另一种用UUID生成随机字符串的方法。 阅读全文
posted @ 2016-06-13 22:01 godlei 阅读(2403) 评论(0) 推荐(0)
摘要: 这个类用来生成指定长度的随机字符串 阅读全文
posted @ 2016-06-13 21:43 godlei 阅读(407) 评论(0) 推荐(0)
摘要: 这个类中提供了对象序列化与反序列化的方法,在实际的项目中会经常被用到。 阅读全文
posted @ 2016-06-13 21:37 godlei 阅读(470) 评论(2) 推荐(1)
摘要: 题目描述: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. 解题分析: 题目要就就是找出 0≤ x < 10n中各位数字都不相同的数的个数。要接触这道题只需要理解: 阅读全文
posted @ 2016-06-13 20:20 godlei 阅读(755) 评论(0) 推荐(0)
摘要: 题目描述: Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in 阅读全文
posted @ 2016-06-13 20:09 godlei 阅读(937) 评论(0) 推荐(0)
摘要: 题目描述: Determine whether an integer is a palindrome. Do this without extra space. 解题分析: ^_^个人觉得这道题没有什么可分析的,直接看代码就能明白^_^. 具体代码: 阅读全文
posted @ 2016-06-08 01:01 godlei 阅读(189) 评论(0) 推荐(0)
摘要: 题目描述: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 解题思路: 这道题比较简单,只要注意两个问题:1,输入可能有123,-123两种情况。2,可能会出现值溢出 阅读全文
posted @ 2016-06-08 00:57 godlei 阅读(188) 评论(0) 推荐(0)
摘要: 题目描述: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed 阅读全文
posted @ 2016-06-08 00:51 godlei 阅读(241) 评论(0) 推荐(0)