Most Stones Removed with Same Row or Column
Input: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]
Output: 5Input: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]]
Output: 3Input: stones = [[0,0]]
Output: 0Analysis & Solution
Union Find 并查集
HashMap implementation of Union Find
Array Implementation of Union Find
DFS
Last updated