It's Raining Tacos
Description:
It's Raining Tacos!
A line of tacos is falling out of the sky onto the landscape.
Your task is to predict what the landscape will look like when the tacos fall on it.
INPUT:
*********
OUTPUT: TACOTACOT
*********
The landscape is represented as any ASCII character, with the air being represented as whitespaces. The rows are separated by newline characters.
Tacos fall from left to right, distributing the word TACO
repeadetly over the landscape. Each letter falls on the topmost part of the landscape in that area.
If there are no characters in that location, the taco falls all the way to the bottom.
INPUT: * **
*** ****
C AC
OUTPUT: TA* T**O
***O****T
If there is no space for tacos to fall, then that space is skipped. The next letter still continues forward in the TACO
sequence.
**
INPUT: ****
******
**CO
OUTPUT: ****TA
******COT
Tacos cannot fall through solid material. If there is a floating island, TACO
should be placed on the island, not below it.
INPUT: *****
COTAC
OUTPUT: *****
TA OT
The width and height of the landscape can be anywhere from 1 to 100.
In the case of an empty string, return an empty string.
Good Luck!
Similar Kata:
Stats:
Created | Sep 3, 2023 |
Published | Sep 4, 2023 |
Warriors Trained | 998 |
Total Skips | 22 |
Total Code Submissions | 1916 |
Total Times Completed | 187 |
JavaScript Completions | 96 |
Rust Completions | 32 |
Java Completions | 35 |
Python Completions | 44 |
Total Stars | 24 |
% of votes with a positive feedback rating | 83% of 51 |
Total "Very Satisfied" Votes | 38 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |