![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 423 阅读 · 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 · 525 阅读 · 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 · 574 阅读 · 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 · 525 阅读 · 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 · 528 阅读 · 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 · 498 阅读 · 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 · 480 阅读 · 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 · 502 阅读 · 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 · 520 阅读 · 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 · 425 阅读 · 0 评论