Back
Close
  • 320

Statement

The program:
The program must output the given map, making the # fall to the bottom of the grid.

The map is composed of '.' and '#'.
INPUT:
Line 1 : Two integers: The map width width and height height.
height next lines : width characters: (. or #).
 
OUTPUT:
height lines : width characters where the # are at the bottom of the grid.
 
CONSTRAINTS:
0 < width < 100
0 < height < 10
 
EXAMPLE:
Input
17 5
...#...#.#.#...#.
.#..#...#....#...
..........#......
..###...###..##..
#################
Output
.................
.................
...##...###..#...
.####..#####.###.
#################
 
Solve it

A higher resolution is required to access the IDE

codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants