随笔分类 - 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
阅读全文
摘要:``` 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
阅读全文
摘要:``` 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...
阅读全文
摘要:``` import apple.laf.JRSUIUtils; / Source : https://oj.leetcode.com/problems/validate binary search tree/ Given a binary tree, determine if it is a va
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.List; / https://leetcode.com/problems/unique bina
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/unique binary search trees/ Given n, how many structurally unique BST's (binary search trees) that sto
阅读全文
摘要:```java import java.util.Arrays; import java.util.Stack; import java.util.TreeMap; / Source : https://oj.leetcode.com/problems/binary tree inorder tra
阅读全文
摘要:``` 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...
阅读全文
摘要:``` / 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
阅读全文
摘要:``` / 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
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/decode ways/ A message containing letters from A Z is being encoded to numbers using the following map
阅读全文
摘要:``` 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/ * * ...
阅读全文
摘要:```
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: * ...
阅读全文
摘要:``` 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
阅读全文
摘要:``` / 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
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/remove duplicates from sorted array ii/ Follow up for "Remove Duplicates": What if duplicates are allo
阅读全文
摘要:``` import java.util.Arrays; / Source : https://oj.leetcode.com/problems/remove duplicates from sorted array/ Given a sorted array, remove the duplica
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/remove duplicates from sorted list ii/ Given a sorted linked list, delete all nodes that have duplicat
阅读全文
摘要:``` 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...
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/remove duplicates from sorted list/ Given a sorted linked list, delete all duplicates such that each e
阅读全文

浙公网安备 33010602011771号