- 博客(7)
- 问答 (1)
- 收藏
- 关注
原创 【leetcode】79 Word Search
Given an m x n grid of characters board and a string word, return true if word exists in the grid.The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cel
2022-01-10 17:02:34 190
原创 JavaScript 初始化二维数组的方法
写题时经常遇到需要初始化二维数组的情况我目前用过三种方法://初始化 n x m 的二维数组//1.const arr = Array.from({length: n}, () => new Array(m).fill(0));//2.const arr = [...Array(n)].map(() => Array(m).fill(0));//3.const arr = new Array(n).fill(0).map((v) => new Array(m).fill
2022-01-10 15:28:11 667
原创 【leetcode】 340 Longest Substring with At Most K Distinct Characters
Given a string s and an integer k, return the length of the longest substring of s that contains at most k distinct characters.Example 1:Input: s = “eceba”, k = 2Output: 3Explanation: The substring is “ece” with length 3.Example 2:Input: s = “aa”, k
2022-01-10 07:00:31 3059
原创 【leetcode】1011. Capacity To Ship Packages Within D Days
A conveyor belt has packages that must be shipped from one port to another within days days.The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We
2022-01-10 06:48:19 183
原创 【leetcode】67 Add Binary
Given two binary strings a and b, return their sum as a binary string.Input: a = “11”, b = “1”Output: “100”// 将string 转为 numberlet a = '1'console.log(typeof +a) // number // 若b为falsy,a为0,否则a = bconst a = b || 0var addBinary = function(a, b) {
2022-01-10 05:18:49 2576
原创 【leetcode】26 Remove Duplicates from Sorted Array
26. Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.Since it is impossible to change the length of the a
2022-01-09 11:26:12 3260
原创 【leetcode】298 Binary Tree Longest Consecutive Sequence(二叉树最长连续序列)
298.Binary Tree Longest Consecutive SequenceGiven the root of a binary tree, return the length of the longest consecutive sequence path.The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connec
2022-01-04 14:13:32 419
空空如也
maven项目中所有导入的jar包都无法使用,是什么原因?
2020-05-18
TA创建的收藏夹 TA关注的收藏夹
TA关注的人