06 2021 档案

摘要:Implement a SnapshotArray that supports the following interface: SnapshotArray(int length) initializes an array-like data structure with the given len 阅读全文
posted @ 2021-06-26 14:14 Grandyang 阅读(1422) 评论(0) 推荐(0) 编辑
摘要:Two players play a turn based game on a binary tree. We are given the root of this binary tree, and the number of nodes n in the tree. n is odd, and e 阅读全文
posted @ 2021-06-21 13:30 Grandyang 阅读(765) 评论(0) 推荐(0) 编辑
摘要:Given an array nums of integers, a move consists of choosing any element and decreasing it by 1. An array A is a zigzag array if either: Every even-in 阅读全文
posted @ 2021-06-21 04:07 Grandyang 阅读(305) 评论(0) 推荐(0) 编辑
摘要:Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of 阅读全文
posted @ 2021-06-18 12:57 Grandyang 阅读(1680) 评论(0) 推荐(0) 编辑
摘要:Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn' 阅读全文
posted @ 2021-06-13 15:47 Grandyang 阅读(518) 评论(0) 推荐(0) 编辑
摘要:On an alphabet board, we start at position (0, 0), corresponding to character board[0][0]. Here, board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", 阅读全文
posted @ 2021-06-11 13:57 Grandyang 阅读(441) 评论(0) 推荐(0) 编辑
摘要:The Tribonacci sequence Tn is defined as follows: T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0. Given n, return the value of Tn. Exa 阅读全文
posted @ 2021-06-08 21:59 Grandyang 阅读(694) 评论(0) 推荐(0) 编辑
摘要:Given two arrays of integers with equal lengths, return the maximum value of: |arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j| where the maximum is 阅读全文
posted @ 2021-06-07 05:45 Grandyang 阅读(424) 评论(0) 推荐(0) 编辑

Fork me on GitHub