![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 70
santiago13lf4fg
这个作者很懒,什么都没留下…
展开
-
leetcode 69 implement the sqrt(x)
Problem: Implement int sqrt(int x). Compute and return the square root of x. Solution: 二分法思想,要特别注意细节部分,有可能的溢出。 class Solution { public: int mySqrt(int x) { if(x < 0)原创 2017-08-25 12:41:19 · 232 阅读 · 0 评论 -
leetcode 50 Implement Pow(x, n)
Problem: Implement the library function implement Pow(x, n) Solution: 该博客给出了几种不同的解题思路,值得参考。 http://blog.csdn.net/fengbingyang/article/details/12236121 下面给出其中一种AC 6ms的代码实现原创 2017-08-25 12:54:39 · 251 阅读 · 0 评论 -
leetcode 350 Intersection of two arrays II
Problem: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each element in the result should appea原创 2017-08-25 13:20:15 · 193 阅读 · 0 评论 -
leetcode 205 Isomorphic Strings
题目原文: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced原创 2017-08-22 21:09:34 · 227 阅读 · 0 评论