2016年6月25日

Leetcode 1.Two Sum

摘要: 暴力可过,复杂度达到了n^2 用map,复杂度为O(nlogn) //暴力版本class Solution {public: vector twoSum(vector& nums, int target) { vectoranswer; for(int i... 阅读全文

posted @ 2016-06-25 18:39 胖胖的乓乓 阅读(81) 评论(0) 推荐(0) 编辑

Leetcode 202. Happy Number

摘要: 202. Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Startin... 阅读全文

posted @ 2016-06-25 17:44 胖胖的乓乓 阅读(111) 评论(0) 推荐(0) 编辑

导航