hyunkookim 님의 블로그

  • 홈
  • 태그
  • 방명록

MaxHeap 2

[Graph: Dijkstra] 1514. Path with Maximum Probability ★★

1514. Path with Maximum Probability 이 문제는 확률 기반 최단 경로 문제로,다익스트라(Dijkstra) 알고리즘을 확률 최대화 버전으로 변형해서 푸는 문제입니다.문장을 하나씩 해석하고 → 문제 핵심 → 해결 아이디어까지 차근히 설명드릴게요. 😊📖 한 문장씩 해석You are given an undirected weighted graph of n nodes (0-indexed),👉 0부터 시작하는 노드 번호를 가진 무방향 가중치 그래프가 주어집니다.represented by an edge list where edges[i] = [a, b]👉 간선 목록 edges[i] = [a, b]는 a와 b 노드를 연결하는 무방향 간선을 의미합니다.with a probability o..

LeetCode/NeetCode 2025.04.10

Heap-PrioiryQueue: 1046. Last Stone Weight

1046. Last Stone Weight https://youtu.be/B-QCq79-Vfw?si=3xrwdkwlsVfUMrM8 class Solution: def lastStoneWeight(self, stones: List[int]) -> int: # 기본적으로 minHeap 이니깐, -1 곱하면 maxheap stones = [-s for s in stones] heapq.heapify(stones) print(stones) while len(stones) > 1: high_1st = heapq.heappop(stones) high_2nd = heapq.heappop(stones) ..

LeetCode/NeetCode 2025.01.20
이전
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

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

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2026/02   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © AXZ Corp. All rights reserved.

티스토리툴바