Regions Cut By Slashes Problem can be found in here! Solution: Disjoint Set Time Complexity: , Space Complexity: , where n is the length of grid and $\alpha(\cdot)$ is the inverse ackermann function, which grows slowly.