Number of Enclaves - Leetcode 1020 - Python