Algorithm which finds the biggest square in C.
• Its first line contains the number of lines on the board (and only that).
• “.” (representing an empty place) and “o” (representing an obstacle) are the only two characters for the other lines.
• All of the lines are of the same length (except the first one).
• It contains at least one line.
• Each line is terminated by ‘\n’.
9
...........................
....o......................
............o..............
...........................
....o......................
..............o............
...........................
......o..............o.....
..o.......o................
./bsq map.txt
.....xxxxxxx................
....oxxxxxxx................
.....xxxxxxxo...............
.....xxxxxxx................
....oxxxxxxx................
.....xxxxxxx...o............
.....xxxxxxx................
......o...............o.....
..o.......o.................
You can only read from the given files.
You have to represent only the biggest square. If they are several solutions, choose the square to the left.
Made in C