摘要: Given isSubstring() which checks if one word is a substring of another, write code to check if s2 is a rotation of s1. class Solution { public bool... 阅读全文
posted @ 2015-02-17 06:37 江南第一少 阅读(139) 评论(0) 推荐(0)
摘要: class Solution { public String compress(String str) { int size = countCompression(str); //先check compress之后的size,若更大,返回原string。 if(size >= str.leng... 阅读全文
posted @ 2015-02-17 06:26 江南第一少 阅读(242) 评论(0) 推荐(0)
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-02-17 00:22 江南第一少 阅读(146) 评论(0) 推荐(0)