04 2020 档案
摘要:package LeetCode_1290 /** * 1290. Convert Binary Number in a Linked List to Integer * https://leetcode.com/problems/convert-binary-number-in-a-linked-
阅读全文
摘要:package LeetCode_713 /** * 713. Subarray Product Less Than K * https://leetcode.com/problems/subarray-product-less-than-k/description/ * * Your are gi
阅读全文
摘要:package LeetCode_930 /** * 930. Binary Subarrays With Sum * https://leetcode.com/problems/binary-subarrays-with-sum/description/ * * In an array A of
阅读全文
摘要:package LeetCode_152 /** * 152. Maximum Product Subarray * https://leetcode.com/problems/maximum-product-subarray/description/ * * Given an integer ar
阅读全文
摘要:package LeetCode_560 /** * 560. Subarray Sum Equals K * https://leetcode.com/problems/subarray-sum-equals-k/description/ * * Given an array of integer
阅读全文
摘要:package LeetCode_310 import java.util.* import kotlin.collections.ArrayList /** * 310. Minimum Height Trees * https://leetcode.com/problems/minimum-he
阅读全文
摘要:package LeetCode_371 /** * 371. Sum of Two Integers * https://leetcode.com/problems/sum-of-two-integers/description/ * https://www.polarxiong.com/arch
阅读全文
摘要:/** * https://www.hackerrank.com/challenges/dynamic-array/problem * */ class DynamicArray { var lastAnswer = 0 var answerList: ArrayList<Int>? = null
阅读全文
摘要:package LeetCode_261 import java.util.* /** * 261. Graph Valid Tree * Lock by leetcode * https://www.lintcode.com/problem/graph-valid-tree/description
阅读全文
摘要:package LeetCode_1306 import java.util.* /** * 1306. Jump Game III * https://leetcode.com/problems/jump-game-iii/description/ * Given an array of non-
阅读全文
摘要:package LeetCode_45 /** * 45. Jump Game II * https://leetcode.com/problems/jump-game-ii/description/ * * Given an array of non-negative integers, you
阅读全文
摘要:/* * queue.push(start) * step = 0 * while (queue.isNotEmpty()){ * step++ * size = queue.size * //scan current level * while (size-->0){ * node = queue
阅读全文
摘要:import java.util.* class Solution { fun minDepth(root: TreeNode?): Int { if (root == null) { return 0 } var depth = 0 //LinkedList实现了Queue接口,可以用作队列使用
阅读全文
摘要:/* * For your reference: * * DoublyLinkedListNode { * int data; * DoublyLinkedListNode next; * DoublyLinkedListNode prev; * } */ static DoublyLinkedLi
阅读全文
摘要:package LeetCode_11 /** * 11. Container With Most Water * https://leetcode.com/problems/container-with-most-water/description/ * */ class Solution { f
阅读全文
摘要:package LeetCode_1367 import LeetCode_1382.TreeNode import LeetCode_390.ListNode /** * 1367. Linked List in Binary Tree * https://leetcode.com/problem
阅读全文
摘要:package LeetCode_486 /** * 486. Predict the Winner * https://leetcode.com/problems/predict-the-winner/description/ * https://www.youtube.com/watch?v=g
阅读全文
摘要:package LeetCode_205 /** * 205. Isomorphic Strings * https://leetcode.com/problems/isomorphic-strings/description/ * */ class Solution { fun isIsomorp
阅读全文
摘要:/* 876. Middle of the Linked List https://leetcode.com/problems/middle-of-the-linked-list/description/ Given a non-empty, singly linked list with head
阅读全文
摘要:What is Krishnamurthy Number? A Krishnamurthy number is a number whose sum of the factorial of digits is equal to the number itself. For example 145,
阅读全文
摘要:package LeetCode_1137 /** * 1137. N-th Tribonacci Number * https://leetcode.com/problems/n-th-tribonacci-number/description/ * * The Tribonacci sequen
阅读全文
摘要:package LeetCode_746 /** * 746. Min Cost Climbing Stairs * https://leetcode.com/problems/min-cost-climbing-stairs/description/ * On a staircase, the i
阅读全文
摘要:package LeetCode_70 /** * 70. Climbing Stairs * https://leetcode.com/problems/climbing-stairs/description/ * */ class Solution { fun climbStairs(n: In
阅读全文
摘要:package LeetCode_198 /** * 198. House Robber * https://leetcode.com/problems/house-robber/description/ * */ class Solution { fun rob(nums: IntArray):
阅读全文
摘要:package LeetCode_139 /** * 139. Word Break * https://leetcode.com/problems/word-break/description/ * * Example 1: Input: s = "leetcode", wordDict = ["
阅读全文
摘要:package LeetCode_405 import java.lang.StringBuilder /** * 405. Convert a Number to Hexadecimal * https://leetcode.com/problems/convert-a-number-to-hex
阅读全文
摘要:package LeetCode_201 /** * 201. Bitwise AND of Numbers Range (数字范围按位相与) * https://leetcode.com/problems/bitwise-and-of-numbers-range/description/ * ht
阅读全文