목록matrix (3)
취미가 좋다
https://leetcode.com/problems/search-a-2d-matrix-ii/ Search a 2D Matrix II - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Solution class Solution: def searchMatrix(self, matrix, target): row, col = 0, len(matrix[0])-1 while row = 0: if matrix[row][col] < t..
https://leetcode.com/problems/maximal-square/ Maximal Square - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Solution class Solution: def maximalSquare(self, matrix): ROW, COL = len(matrix), len(matrix[0]) ans = 0 for i in range(COL): matrix[0][i] = 1 if matrix[0][i]=='1' else 0 ..
https://leetcode.com/problems/number-of-islands/ Number of Islands - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Solution class Solution: def __init__(self): self.m = 0 self.n = 0 self.grid = [] self.visit = [] def numIslands(self, grid): self.m = len(grid) self.n = len(grid[0]..