Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function building(input) {
- let floors = Number(input[0]);
- let rooms = Number(input[1]);
- for (let f = floors; f >= 1; f--) {
- let output = "";
- for (let r = 0; r < rooms; r++) {
- if (f === floors) {
- output += "L" + f + r + " ";
- } else if (f % 2 === 0) {
- output += "O" + f + r + " ";
- } else {
- output += "A" + f + r + " ";
- }
- }
- console.log(output.trim());
- }
- }
Add Comment
Please, Sign In to add comment