@JimHYC
Leetcode
Nothing here yet.
Nothing here yet.
Jun 8, 2022 · 1 min read · Problem Link Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order. Example: Input: n = 32 Output: [1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,32,4,5,6,7,8,9] class Solution: ...
Join discussionJun 7, 2022 · 1 min read · Problem Link Given an integer array nums and two integers k and t, return true if there are two distinct indices i and j in the array such that abs(nums[i] - nums[j]) <= t and abs(i - j) <= k. Solution Bucket size: t + 1 class Solution: def c...
Join discussionJun 6, 2022 · 1 min read · Problem Link Let dpVer[i][j] := the number of continuous 1’s from grid[0][j-1] to grid[i-1][j-1] Let dpHor[i][j] := the number of continuous 1’s from grid[i-1][0] to grid[i-1][j-1] class Solution: def largest1BorderedSquare(self, grid: List[List[...
Join discussion