Loading environment...
You are given an Christmas map. Each cell contains either:
'S' — snow, representing a snowy patch'.' — ground, representing regular landTwo snowy cells are considered connected if they touch up, down, left, or right (4-directional).
Your task is to determine how many separate snowy puddles exist on Santa’s map. Think of each connected group of 'S' cells as a snow puddle that Santa might step in while delivering presents!
Constraints:
'S' and `'.'$.Output a single integer — the number of connected snowy puddles on the map.
No comments yet. Be the first to comment!