摘要: 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; ... 阅读全文
posted @ 2017-02-13 16:45 copperface 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-02-13 14:40 copperface 阅读(227) 评论(0) 推荐(0) 编辑