You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #75 on September 15, 2026 11:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem link
https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/
Problem Summary
자신과 상하좌우 4개 비트를 반전시킬 수 있을 때 모든 비트를 0으로 만드는 최소 횟수를 구하는 문제.
Solution
딱 보니 배열 크기도 작고 최소 횟수이므로 BFS로 돌려주면 된다.
하나 까다로운 것은 2차원 리스트를 큐나 방문 set에 넣고 빼고 하는 것인데.. set에 넣기 위해 tuple로 바꾸고...수정하기 위해 리스트로도 바꾸고... 좀 복잡하게 구현하긴 하였다.
Source Code
All reactions