Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Given: An array of strings where L indicates land and W indicates water,
- * and a coordinate marking a starting point in the middle of the ocean.
- *
- * Challenge: Find and mark the ocean in the map by changing appropriate Ws to Os.
- * An ocean coordinate is defined to be the initial coordinate if a W, and
- * any coordinate directly adjacent to any other ocean coordinate.
- *
- * void findOcean(String map, int row, int column);
- *
- * String map = new String{
- * “WWWLLLW”,
- * “WWLLLWW”,
- * “WLLLLWW”
- * };
- * printMap(map);
- *
- * STDOUT:
- * WWWLLLW
- * WWLLLWW
- * WLLLLWW
- *
- * findOcean(map, 0, 1);
- *
- * printMap(map);
- *
- * STDOUT:
- * OOOLLLW
- * OOLLLWW
- * OLLLLWW
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement