摘要:
刷 July 17 2019 第一反应是每个String都sort一下,然后分类,事实上也是正确的。。 Time: O(n KlgK) Space: O(nk) k = length of word 上面其实没用Anagram的另一个特性, char出现的次数相等就行 ,所以sort的KlgK其实浪 阅读全文
摘要:
这个题不怎么容易。。 正常做两头只找大小写和数字。 用rex简单很多。。 java public class Solution { public boolean isPalindrome(String s) { int l = 0; s = s.trim().toLowerCase().replac 阅读全文
摘要:
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Not 阅读全文