
Leetcode
Junyuan12
这个作者很懒,什么都没留下…
展开
-
Leetcode004-Median of Two Sorted Arrays
ProblemMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:There are two sorted arrays nums1 and num...原创 2019-11-07 20:41:51 · 241 阅读 · 0 评论 -
Leetcode042-Trapping-Rain-Water
Note: 这是一个没通过内存测试的解决方案,但是思路我觉得还可以,只是记录一下,方便日后学习。ProblemGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after r...原创 2019-10-23 16:51:18 · 213 阅读 · 0 评论 -
Leetcode021-Merge Two Sorted Lists
ProblemMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Outpu...原创 2019-10-17 18:15:26 · 156 阅读 · 0 评论 -
Leetcode013-Roman to Integer
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2019-03-29 20:14:20 · 209 阅读 · 0 评论 -
Leetcode026-Remove Duplicates from Sorted Array
Given a sorted array nums, 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 by modifyin...原创 2019-04-23 16:48:03 · 188 阅读 · 0 评论 -
Leetcode035-Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Ex...原创 2019-04-29 13:25:58 · 292 阅读 · 0 评论 -
Leetcode002-Add Two Numbers
本打算好好看看数据结构,结果看到递归后就被一些乱七八糟的事一直拖着,一直也没往下看,而且隔段时间不回去看一下,就容易忘了,所以心血来潮,挑战了了第一道Medium,其实也没想的那么难,只不过考虑的东西要比Easy的多一些而已,然而,能踩的坑我还是都踩了一遍。ProblemYou are given two non-empty linked lists representing two non-...原创 2019-05-25 16:15:30 · 206 阅读 · 0 评论 -
Leetcode003-Longest Substring Without Repeating Characters
ProblemGiven a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example...原创 2019-10-11 13:39:32 · 145 阅读 · 0 评论