随笔分类 -  leetcode

摘要:``` import java.util.Stack; / Source : https://oj.leetcode.com/problems/symmetric tree/ Given a binary tree, check whether it is a mirror of itself (i 阅读全文
posted @ 2017-11-09 00:45 lacker 阅读(195) 评论(0) 推荐(0)
摘要:``` import java.util.Stack; / Source : https://oj.leetcode.com/problems/same tree/ Given two binary trees, write a function to check if they are equal 阅读全文
posted @ 2017-11-08 08:20 lacker 阅读(152) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * Source : https://oj.leetcode.com/problems/recover-binary-search-tree/ * * * Two... 阅读全文
posted @ 2017-11-08 08:18 lacker 阅读(174) 评论(0) 推荐(0)
摘要:``` import apple.laf.JRSUIUtils; / Source : https://oj.leetcode.com/problems/validate binary search tree/ Given a binary tree, determine if it is a va 阅读全文
posted @ 2017-11-06 08:21 lacker 阅读(267) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.List; / https://leetcode.com/problems/unique bina 阅读全文
posted @ 2017-11-05 19:36 lacker 阅读(243) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/unique binary search trees/ Given n, how many structurally unique BST's (binary search trees) that sto 阅读全文
posted @ 2017-11-05 19:35 lacker 阅读(125) 评论(0) 推荐(0)
摘要:```java import java.util.Arrays; import java.util.Stack; import java.util.TreeMap; / Source : https://oj.leetcode.com/problems/binary tree inorder tra 阅读全文
posted @ 2017-11-05 19:34 lacker 阅读(146) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * Source : https://oj.leetcode.com/problems/restore-ip-addresses/ * * * * Given a... 阅读全文
posted @ 2017-11-05 19:30 lacker 阅读(170) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/reverse linked list ii/ Reverse a linked list from position m to n. Do it in place and in one pass. Fo 阅读全文
posted @ 2017-11-02 22:25 lacker 阅读(161) 评论(0) 推荐(0)
摘要:``` / Source : https://leetcode.com/problems/reverse linked list/ Reverse a singly linked list. click to show more hints. Hint: A linked list can be r 阅读全文
posted @ 2017-11-02 22:24 lacker 阅读(132) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/decode ways/ A message containing letters from A Z is being encoded to numbers using the following map 阅读全文
posted @ 2017-11-02 22:23 lacker 阅读(186) 评论(0) 推荐(0)
摘要:``` import org.lep.leetcode.groupanagrams.GroupAnagram; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://oj.leetcode.com/problems/gray-code/ * * ... 阅读全文
posted @ 2017-10-31 08:24 lacker 阅读(120) 评论(0) 推荐(0)
摘要:``` import java.util.Arrays; /** * Source : https://oj.leetcode.com/problems/merge-sorted-array/ * * * Given two sorted integer arrays A and B, merge B into A as one sorted array. * * Note: * ... 阅读全文
posted @ 2017-10-31 08:23 lacker 阅读(123) 评论(0) 推荐(0)
摘要:``` import java.util.Arrays; / Source : https://oj.leetcode.com/problems/scramble string/ Given a string s1, we may represent it as a binary tree by p 阅读全文
posted @ 2017-10-31 00:03 lacker 阅读(173) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/partition list/ Given a linked list and a value x, partition it such that all nodes less than x come b 阅读全文
posted @ 2017-10-31 00:02 lacker 阅读(152) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/remove duplicates from sorted array ii/ Follow up for "Remove Duplicates": What if duplicates are allo 阅读全文
posted @ 2017-10-30 08:22 lacker 阅读(168) 评论(0) 推荐(0)
摘要:``` import java.util.Arrays; / Source : https://oj.leetcode.com/problems/remove duplicates from sorted array/ Given a sorted array, remove the duplica 阅读全文
posted @ 2017-10-30 08:21 lacker 阅读(107) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/remove duplicates from sorted list ii/ Given a sorted linked list, delete all nodes that have duplicat 阅读全文
posted @ 2017-10-29 22:56 lacker 阅读(118) 评论(0) 推荐(0)
摘要:``` import java.util.Stack; /** * * Source : https://oj.leetcode.com/problems/largest-rectangle-in-histogram/ * * * Given n non-negative integers representing the histogram's bar height where th... 阅读全文
posted @ 2017-10-29 22:56 lacker 阅读(120) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/remove duplicates from sorted list/ Given a sorted linked list, delete all duplicates such that each e 阅读全文
posted @ 2017-10-27 08:33 lacker 阅读(140) 评论(0) 推荐(0)