math
MVincent
这个作者很懒,什么都没留下…
展开
-
leetcode 9 Palindrome Number
c++:class Solution { public: bool isPalindrome(int x) { if(x<0) return false; std::string str = std::to_string(x); for(std::string::iterator i = str.begin(), j = str.end...原创 2018-06-03 14:51:05 · 157 阅读 · 0 评论 -
leetcode 168 Excel Sheet Column Title
python:class Solution: def convertToTitle(self, n): """ :type n: int :rtype: str """ ans = '' while n > 0: n = n - 1 j = ...原创 2018-06-03 21:07:24 · 168 阅读 · 0 评论 -
leetcode 263 Ugly Number
python:class Solution: def isUgly(self, num): """ :type num: int :rtype: bool """ if num == 1 : return True if num == 0: ret...原创 2018-06-04 16:05:06 · 157 阅读 · 0 评论 -
leetcode 69 Sqrt(x)
python: class Solution: def mySqrt(self, x): """ :type x: int :rtype: int """ left = 0 right = x while (left <= right): mid...原创 2018-09-03 14:52:14 · 187 阅读 · 0 评论 -
leetcode 645 Set Mismatch
python: class Solution: def findErrorNums(self, nums): """ :type nums: List[int] :rtype: List[int] """ l = len(nums) res = [] res.append(s...原创 2018-09-13 15:09:11 · 326 阅读 · 0 评论