- 博客(13)
- 收藏
- 关注
转载 LeetCode Note: ++i or i++
It's quite funny that there is a very apparent question but few people care about. That is the difference between the '++i' and the 'i++'. The first time that I found this question was when I saw the ...
2018-04-18 17:37:45 183
原创 LeetCode 13 level 0
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D 5...
2018-05-17 15:58:54 116
原创 Leetcode 21 level 0
Merge 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->4Output: 1->1...
2018-05-17 14:50:35 151
原创 Leetcode 128 level 1
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.Your algorithm should run in O(n) complexity.Example:Input: [100, 4, 200, 1, 3, 2]Output: 4Explanati...
2018-05-10 00:48:20 150
原创 LeetCode 19 level 2
Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the li...
2018-05-09 23:33:18 133
原创 Leetcode 260 level 2
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums = [1,...
2018-05-07 12:49:40 131
原创 Leetcode 94 level 0
Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recursive solution is trivial, could...
2018-04-18 21:32:06 148
原创 Leetcode 238 level 2
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n).F...
2018-04-18 19:04:47 136
原创 Leetcode 283 level 0
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling your func...
2018-04-18 18:25:48 140
原创 Leetcode 136 level 1
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra mem...
2018-04-18 17:56:14 120
原创 Leetcode 104 level 0
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.For example:Given binary tree [3,9,20,null...
2018-04-18 17:22:50 128
原创 2018/03 - 面试准备(算法篇)
前言除了基础知识以外,算法也是面试中比较固定的一个部分。因此也是在这里梳理一些国内几个大厂经常用到的算法,查漏补缺。一、实现一个计算器(腾讯真题)二、实现atoi,字符串到INT(今日头条真题)答:这道题目比较基础。题目的难点可能在于需要明确一下几个情况:1、正负数问题;2、是否可能会溢出INT(0x7fffffff);3、是否会存在非法的字符;4、进制能够保证合法。三、无序数组,找出最小的k个数...
2018-03-27 22:55:11 165
原创 2018/03 - 面试准备
前言国内找一个实习的确是很扎实,毕竟都是冲着return去的。像我这种太久没有使用基础知识+平时没有太多时间复习的人来说,面试成功一个国内企业的实习真的是非常的难了。难,但是我不想放弃,别人都丢下的东西,我捡起来了,绝对是只有好处的。因此在18年的3月写下这个汇总博客。这个博客相当于我现在面试国内企业的一个资料库。网上的答案缤纷繁杂,这里的答案都是我自己理解以后发出来的,比网络上的散答案肯定好了很...
2018-03-27 22:46:45 177
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人