Tuesday common C++ interview problem: Counting islands.
Given a map as a std::vector<std::vector<char>> where 'L' represents land and 'W' represents water, return the number of islands on the map.
An island is an orthogonally (four directions) connected area of land spaces that is fully (orthogonally) surrounded by water.
Solve it yourself: https://compiler-explorer.com/z/Y8o6ahK41
Solution: https://compiler-explorer.com/z/58oW9v8KG