Count connected regions in an N x N grid of '/' and '\\' characters.
Constraints
Example
>>> regions_by_slashes([" /", "/ "]) # note: strings are length 2: [' /', '/ '] 2 >>> regions_by_slashes([" /", " "]) 1 >>> regions_by_slashes(["/\\", "\\/"]) 5 >>> regions_by_slashes(["//", "/ "]) 3
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints