标签:
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
solution:直接乘会超时~~所以只能用递归~~
public class Solution { public static double Power(double x ,int n){ if(n==0){ return 1; } double v=Power(x,n/2); if(n%2==0){ return v*v; }else{ return v*v*x; } } public static double pow(double x ,int n){ if(n>=0){ return Power(x,n); }else{ return 1/Power(x,-n); } } }
标签:
原文地址:http://www.cnblogs.com/joannacode/p/4416162.html