Java
文章平均质量分 65
Macuilx0chitl
这个作者很懒,什么都没留下…
展开
-
Java方法参数
class Test { public static void main(String[] args) { int[] arr = { 1, 2, 3, 4 }; int i = 1; Test test = new Test(); System.out.println(arr[0]); System.out.println(i); System.原创 2017-01-17 05:33:35 · 340 阅读 · 2 评论 -
LintCode-合并排序数组 II
合并两个排序的整数数组A和B变成一个新的数组。 样例 给出 A = [1, 2, 3, empty, empty], B = [4, 5] 合并之后 A 将变成 [1,2,3,4,5]看起来很简单的一道题,然后本来用一个循环来insert再排一次序就好了。class Solution { /** * @param A: sorted integer ar原创 2017-01-17 21:21:23 · 370 阅读 · 0 评论 -
LeetCode-141. Linked List Cycle
本来开开心心在刷题,前面一道easy的题五分钟搞定了,然后pick one一看,还是easy,以为还是五分钟搞定。结果写了几个小时没写出来,真气。141.Linked List Cycle Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without usin原创 2017-02-09 18:03:25 · 362 阅读 · 0 评论 -
LeetCode-16. 3Sum Closest
16 . 3Sum Closest原创 2017-02-02 02:36:39 · 408 阅读 · 0 评论 -
LeetCode-303. Range Sum Query - Immutable
本来真的是超简单一道题,但是数据量一大却变得不好处理。这道题也让我明白了在数据量不同的情况下完成相同的任务是完全不同的难度。303.Range Sum Query - Immutable Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.原创 2017-02-14 20:13:25 · 289 阅读 · 0 评论 -
巨烦人的TLE
最近刷题的时候老是遇到TLE,真的很气啊,比如: 卧槽,都160/161 test cases passed了,结果又死在TLE,很郁闷啊。 虽然我承认看到TLE比看到WA舒服点,因为起码我算法的正确性保证了……(嗯……) 好了废话不多说,看题原创 2017-03-24 01:01:55 · 429 阅读 · 0 评论 -
LeetCode-3. Longest Substring Without Repeating Characters
3.Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is原创 2017-03-28 00:04:44 · 200 阅读 · 0 评论 -
LeetCode-2. Add Two Numbers
刚刚我经历了可能是2017年3月22号的最大的大起大落。原创 2017-03-23 00:21:01 · 915 阅读 · 0 评论 -
这个世界上最爽的事情,就是一次通过编译并且结果正确
本来闲得无聊打算收拾收拾出门射箭,突然有个朋友来问了我个问题。于是顺手做了一下。17.编写一个字符界面的Java Applicantion程序,接受用户输入的字符,以“#”标志输入的结束:比较并输出按字典序最小的字符这道题最难的地方大概就是理解什么是字典序。 废话不多说,上代码。import java.util.ArrayList;public class Solution { public原创 2017-03-14 14:33:38 · 488 阅读 · 0 评论