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. For example, given array S = {-1 0 1 2 -1 -4}, A solution set is: (-1, 0, 1) (-1, -1, 2) 额外…
题目: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. leetcode的题目真是越来越经典了.比如这个题目,就是一道男默女泪的题. 一般人拿到这个题目,除非做过类似的,很难一眼找出一个方法来,更别说找一个比较优化的方法了. 首先一个难点就是,你怎么判断某个区域就是一个矩形呢? 其次,以何种方式来遍历这个2D的…
本系列教程供个人学习笔记使用,如果您要浏览可能需要其它编程语言基础(如C语言),why?因为我写得烂啊,只有我自己看得懂!! python中的list列表是一种序列型数据类型,一有序数据集合用逗号间隔用方括号括起来,和字符串一样可以通过索引index和切片来访问某个元素或子列表. 元组相当于一个只读的列表,它的元素不可修改. 字典是一种键值对. list列表可以类比于其它语言(如,C语言)的数组,其起始下标为也为0.1.列表的索引访问 1)通过list_name[index]来访问,每个列表的起…
题目:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example,S = "ADOBECODEBANC"T = "ABC" Minimum window is "BANC". Note:If there is no such windo…
题目: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such w…
题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()", which has length = 2. Another example i…
题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of j…
前几节都是基础中的基础,从第三讲的笔记开始,每次笔记针对Java的一个知识块儿.  Java异常处理 1.什么是异常? 异常是指运行期出的错误.比如说:除以一个0:数组越界:读取的文件不存在. 异常处理,要把异常控制在程序员合理范围之内.如数组越界indexOutOfArray,在用户看来是不可以被理解的,所以,程序员要捕获这种异常,反馈到前端告诉用户是“超出了范围”. Java中针对异常事件,自动生成一个异常对象.这个异常对象封装了异常事件的信息并将其提交给Java运行时系统.Java运行时系…
题目:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. You may not alter the values in the nodes, only…
1.实现效果:动态显示进度(分别显示了整个的动态改变的过程,然后完成后,弹出一个对话框)       2.实现过程:可以分为绘制一个圆,圆弧和文本三部分,然后在MainAcitivity中通过线程模拟下载进度. a.定义一个类继承至view,然后添加其构造函数,记得一定要添加含有Attributset参数的构造函数; b.定义和初始化一些数据: private int mCircleXY; private int mWidth; private float mRadius; private Pa…