hyunkookim 님의 블로그

  • 홈
  • 태그
  • 방명록

2025/01/23 2

Graphs: 1091. Shortest Path in Binary Matrix ★★★

1091. Shortest Path in Binary Matrix 가장 짧은 경로 문제: BFS => 큐     cf) 목적지까지 갈수있는 경로 개수: DFS => 재귀 class Solution: def shortestPathBinaryMatrix(self, grid: List[List[int]]) -> int: N = len(grid) # n x n matrix if not grid: return -1 if grid[0][0] == 1 or grid[N-1][N-1] == 1: return -1 # shotedpath: using bfs, que def bfs(grid): q..

LeetCode/NeetCode 2025.01.23

Graphs: 695. Max Area of Island ★

695. Max Area of Island BFS로 풀기from typing import Listfrom collections import dequeclass Solution: def maxAreaOfIsland(self, grid: List[List[int]]) -> int: # 섬 개수 및 최대 면적을 계산하는 함수 # Count the number of islands and calculate the maximum area # 네 방향 이동: 상, 하, 좌, 우 # Directions for movement: up, down, left, right directions = [[1, 0], [-1, 0], [0, 1], [..

LeetCode/NeetCode 2025.01.23
이전
1
다음
더보기
프로필사진

hyunkookim 님의 블로그

hyunkookim 님의 블로그 입니다.

  • 분류 전체보기 (457)
    • 개인 연구 (0)
    • job 인터뷰 (34)
      • 2025년 1분기 USA (2)
      • 코테(Amazon) 준비 (5)
      • 코테(Matroid) 준비 (27)
      • 코테 문제 (0)
    • 세팅 (7)
      • ubuntu (7)
    • 코드 형상 관리 (2)
      • git (2)
    • Coding Test (72)
      • 알고리즘 이론 (70)
      • Machine Learning (NeetCode) (2)
    • HackerRank (1)
      • 공통 (1)
    • CodeSignal (1)
      • 문제 은행 (1)
    • LeetCode (329)
      • 공통 (7)
      • Grind169 (60)
      • NeetCode (98)
      • Top Interview 150 (68)
      • LeetCode75 (34)
      • DP심화 (38)
      • 주제별 보충 (23)
      • [Weekly Contest] (0)
    • Deep Learning (4)
      • 3D 재구성 (0)
      • 장면 스타일 변환 (2)
      • 물체 인지 & 추적 (0)
      • 렌더링AI (2)
    • 일단 리스트업 (6)
      • 딥러닝 (2)
      • 코딩 테스트 (2)
      • 기타 (2)

Tag

dp, 우선순위큐, neetcode150, BFS, Backtracking, dfs, array / string, LeetCode, tree, Coding Test, leetcode75, 슬라이딩윈도우, 오블완, 티스토리챌린지, top150, heap, Two pointers, neetcode, 누적합, BST,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/01   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바