![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
我的Leetcode之旅
CodingGirl121
这个作者很懒,什么都没留下…
展开
-
leetcode难度及面试频率
转载自:LeetCode Question Difficulty Distribution1Two Sum25arraysortsetTwo P转载 2015-01-06 14:38:17 · 643 阅读 · 0 评论 -
leetcode挨个儿刷150507(7):Plus One
超级简单的一道题,就是把一个整数加上一,只是这个整数是保存在vector里面的。注意的是最高位存在第0个位置。可是这个题这么简单,我还错,真是醉了!!!不过,一边实习上班,一边抽代码运行的空隙里刷道题确实也是分心了,哎。题目:Given a non-negative number represented as an array of digits, plus one t原创 2015-05-07 17:46:33 · 440 阅读 · 0 评论 -
leetcode挨个儿刷150514(8):Remove Duplicates from Sorted Array
题目内容:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in原创 2015-05-14 19:24:03 · 393 阅读 · 0 评论 -
leetcode挨个儿刷150514(9):Remove Duplicates from Sorted Array II
题目内容:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5, with the原创 2015-05-14 19:57:10 · 432 阅读 · 0 评论 -
leetcode挨个儿刷150515(10):Search in Rotated Sorted Array
题目内容:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the原创 2015-05-15 14:21:52 · 393 阅读 · 0 评论 -
leetcode挨个儿刷150428(3):Two Sum
题目: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, w原创 2015-04-28 20:23:03 · 422 阅读 · 0 评论 -
leetcode挨个儿刷150428(4):Add Two Numbers
题目详情:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as原创 2015-04-28 21:21:41 · 508 阅读 · 0 评论 -
leetcode挨个儿刷150430(6):Median of Two Sorted Arrays
今天这道题在Leetcode标注的是hard,但是我觉得超级简单。很可能是自己的思路还有问题,或者复杂度还有问题吧。不过目前是满足题目要求了。后续还需要思考一下,怎么样继续优化它。加油。题目内容:There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the原创 2015-04-30 20:28:03 · 472 阅读 · 0 评论 -
leetcode挨个儿刷150429(5):Longest Substring Without Repeating Characters
题目内容:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length i原创 2015-04-29 22:27:46 · 422 阅读 · 0 评论 -
leetcode挨个儿刷150105(2):Remove Nth Node From End of List
这个题做完了不仅对自己的粗心表示深深地痛心,这么简单的一道题,还提交了几次,就因为自己脑卡了,起初把结点p作为head结点的前一个节点,后面在统计结点个数的时候,居然把它当做自由结点,移动了,怪不得结果一直不对呢。忽然想起了很久很久以前,听一个学长分享自己的代码刷题经验的时候说道,我们在写程序时,一定要想好了,什么是可以改变的,什么是不能变的,再去写,不要匆匆忙忙,不然调试将是一件非常痛苦的事原创 2015-01-05 21:27:22 · 476 阅读 · 0 评论 -
leetcode挨个儿刷150105(1):Merge Two Sorted Lists
随着找工作的日期一天天的逼近,是时候在科研之余写一写面试题中可能出现的代码了,虽然说经常看开源框架的代码,在面对这些简短的题目时还是感觉有点儿难度,好在题目不多,索性从最简单的做起来呗,加油!争取每周做五个,每周末来个总结吧。Long Way To Go!No1: https://oj.leetcode.com/submissions/detail/17943308/Merge tw原创 2015-01-05 19:43:11 · 529 阅读 · 0 评论 -
Leetcode 382. Linked List Random Node 以及 水塘抽样算法
题目:http://blog.csdn.net/javastart/article/details/50610868Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chose原创 2017-03-12 23:16:21 · 560 阅读 · 0 评论