LeetCode
文章平均质量分 67
对leetCode中的题目,进行交流以及分析。
BabysBreath_hl
切骄切燥
展开
-
【 LeetCode】4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 =原创 2017-08-21 17:32:02 · 578 阅读 · 0 评论 -
LeetCode-8. String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca原创 2017-07-21 22:54:29 · 709 阅读 · 0 评论 -
数字的反转
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321备注:当数字溢出时,则程序返回0。解题思路:1、用一个变量y(初始化为0)保存改变之后的值;2、将x的个位取下来,并且y乘上10,然后对加上x;3、判断y-x的个位除以10,时候原创 2017-06-29 23:57:54 · 3191 阅读 · 0 评论 -
【LeetCode】Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i原创 2017-07-04 20:25:20 · 451 阅读 · 0 评论