![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 78
lwfcgz
北大小硕,各种渣。。。
展开
-
【leetcode】 3Sum
题目:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.分析:http://leetcode.com/2010/04/fin原创 2013-07-13 12:04:10 · 871 阅读 · 0 评论 -
【leetcode】 Longest Substring Without Repeating Characters
要想出O(n)的算法来解决此题,关键是确定一个良好的扫描策略,避免重复的无谓扫描。详细分析可见http://leetcode.com/2011/05/longest-substring-without-repeating-characters.html下面是Java实现:import java.util.Arrays;public class Solution { pub原创 2013-06-30 12:13:56 · 2300 阅读 · 0 评论 -
【leetcode】 add two number
链表的基本操作,注意其中某个链表为空时,只要进位非零或者另外一个链表非空,依然可以继续进行相应的加法,避免产生NullPointerException的错误。下面是我用Java实现的,跑large input需要1100ms左右。/** * Definition for singly-linked list. * public class ListNode { * i原创 2013-06-30 11:44:25 · 747 阅读 · 0 评论 -
【单调队列】leetcode MinStack
题目在这里:https://oj.leetcode.com/problems/min-stack/和普通的栈zhiyouyidianqubie原创 2014-11-16 17:03:14 · 1046 阅读 · 0 评论