██████╗ ██████╗ ██████╗ ███████╗ ███████╗███╗ ██╗ █████╗ ████████╗ ██████╗██╗ ██╗██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝████╗ ██║██╔══██╗╚══██╔══╝██╔════╝██║ ██║██║ ██║ ██║██║ ██║█████╗ ███████╗██╔██╗ ██║███████║ ██║ ██║ ███████║██║ ██║ ██║██║ ██║██╔══╝ ╚════██║██║╚██╗██║██╔══██║ ██║ ██║ ██╔══██║╚██████╗╚██████╔╝██████╔╝███████╗ ███████║██║ ╚████║██║ ██║ ██║ ╚██████╗██║ ██║ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
Learn · Earn · Connect
Difficulty: Medium
Given a binary matrix, find the distance of each cell to the nearest 0 using multi-source BFS.