Algorithm · Pinterest · Easy
Count Objects A pin grid is a rectangular pixel image. The '' cells form objects such as clothing items or accessories, and each object is one connected cluster of '' cells. Cells marked '_' are background and do not belong to any object. You cannot directly see which pixels belong to which object. Instead, you have access to a black-box query: The query returns true exactly when p1 and p2 are pixels in the same object. It returns false when they are in different objects or…
Checking your access…