摘要:
Implement pow(x, n).解题思路:直接使用乘法实现即可,注意下,如果n很大的话,递归次数会太多,因此在n=10和n=-10的地方设置一个检查点,JAVA实现如下:static public double myPow(double x, int n) { if(n==1)... 阅读全文
摘要:
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.解题思路:首先要理解,什么是anagrams,ie。“tea”、“tae”... 阅读全文
摘要:
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?解题思路:找规律即可,JAVA... 阅读全文
摘要:
Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following unique pe... 阅读全文
摘要:
Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1... 阅读全文
摘要:
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
摘要:
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th... 阅读全文