摘要: 非In-place很好做,就是纸上画一个然后转一下举个例子 1 public void rotate(int[][] matrix) { 2 if(matrix == null || matrix.length == 0) { 3 return; 4 } 5 int n = matrix.lengt 阅读全文
posted @ 2016-03-02 04:55 warmland 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 单纯做出来倒是没什么难度,但是优化不优化就需要多想想了。 自己的思路大概是: 1. 为一组anagram建HashMap的一条记录,key是这个词转成charArray的string,因为anagram字母排序后是一样的,value是一个List,里面装的是遇到的词 2.扫完之后遍历map,对每个l 阅读全文
posted @ 2016-03-02 03:54 warmland 阅读(234) 评论(0) 推荐(0) 编辑