![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
xueweiweiwei
这个作者很懒,什么都没留下…
展开
-
LeetCode 题目总结/分类
利用堆栈: http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心) http://oj.leetcode.com/problems/valid-parentheses/转载 2016-12-05 19:50:31 · 266 阅读 · 0 评论 -
leetcode-1 Two Sum 找到数组中两数字和为指定和
问题描述:在一个数组(无序)中快速找出两个数字,使得两个数字之和等于一个给定的值。假设数组中肯定存在至少一组满足要求。 public class test1 { public static int[] twoSum(int[] nums, int target) { for (int i = 0; i for (int j = i + 1; j if (num转载 2016-12-05 19:53:14 · 265 阅读 · 0 评论 -
LeetCode(8)String to Integer (atoi)
将string类型的字符串转换成整型数据 public int Stringtointeger(String str) { char[] charArr=str.toCharArray(); Long result=0L; int startIndex=0; boolean flag=true;//正数 int转载 2016-12-05 19:54:44 · 178 阅读 · 0 评论