摘要:
Implement pow(x, n).分析该题目首先想到可以使用recursion去做,需要考虑一个陷阱,当 n 为 INT_MIN,反转会溢出1234567891011class Solution {public: double myPow(double x, int num) { long n = num; if(n == 0) return 1; ... 阅读全文
摘要:
Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"] ]Note: All 阅读全文