leetcode
傻的可爱
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Remove Element
public int removeElement(int[] A, int elem) { // Start typing your Java solution below // DO NOT write main() function int length = A.length; int count = 0; int原创 2013-05-18 14:23:05 · 477 阅读 · 0 评论 -
Median of Two Sorted Arrays
public double findMedianSortedArrays(int a[], int b[]) { // Start typing your Java solution below // DO NOT write main() function int length = a.length + b.length; int原创 2013-05-14 10:01:10 · 576 阅读 · 0 评论 -
Train Problem
public boolean train(List in ,List out, int number){ boolean ret = true; if(in == null || out == null){ return false; } if(in.size() != number || out.size() != number){ return false; }原创 2013-05-19 16:05:26 · 626 阅读 · 0 评论 -
Valid Parentheses
public boolean isValid(String s) { // Start typing your Java solution below // DO NOT write main() function if(s == null || "".equals(s)){ return true; } Stack原创 2013-05-19 10:06:19 · 571 阅读 · 0 评论 -
Generate Parentheses
public class Solution { public ArrayList generateParenthesis(int n) { // Start typing your Java solution below // DO NOT write main() function ArrayList ret = new ArrayList();原创 2013-05-19 09:47:55 · 578 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
public int lengthOfLongestSubstring(String s) { // Start typing your Java solution below // DO NOT write main() function int max = 0; int tempMax = 0; int lengt原创 2013-05-18 14:25:51 · 548 阅读 · 0 评论 -
Remove Duplicates from Sorted Array
public int removeDuplicates(int[] A) { // Start typing your Java solution below // DO NOT write main() function if(A == null || A.length == 0){ return 0; }原创 2013-05-18 14:23:54 · 536 阅读 · 0 评论 -
Merge k Sorted Lists
public ListNode mergeKLists(ArrayList lists) { // Start typing your Java solution below // DO NOT write main() function ListNode head = null; ListNode cur = head;原创 2013-05-18 14:22:15 · 548 阅读 · 0 评论 -
Add two numbers
public ListNode addTwoNumbers(ListNode l1, ListNode l2) { // Start typing your Java solution below // DO NOT write main() function ListNode head = null; ListNode next = null;原创 2013-05-18 14:30:49 · 567 阅读 · 0 评论 -
Reverse Integer
public int reverse(int x) { if(x == 0) return 0; String s = Integer.toString(x); //起点 boolean isNegative = false; int start = 0; if(s.charAt(原创 2013-05-14 14:19:45 · 475 阅读 · 0 评论
分享