6 kyu
Coding 3min : Tidy up the room
129myjinxin2015
Description:
This is the simple version of Shortest Code series. If you need some challenges, please try the challenge version
Task:
Give you a room
(n x n matrix), there are some sundries(any character except spaces). Our task is to put the sundries neatly placed in the upper left corner of the room(a small metrix)
Example:
example1:
room:[
["a"," "," "," "," "],
[" "," ","b"," "," "],
[" "," "," "," "," "],
[" ","c"," "," "," "],
[" "," ","d"," "," "]
]
There are 4 sundries in the room(a,b,c,d), so we put them in the 2x2 matrix, output should be:
[
["a","b"," "," "," "],
["c","d"," "," "," "],
[" "," "," "," "," "],
[" "," "," "," "," "],
[" "," "," "," "," "]
]
example2:
room:[
["a"," "," "," "," "],
[" "," ","b"," "," "],
[" "," "," "," "," "],
[" ","c"," "," "," "],
[" "," ","d","e"," "]
]
There are 5 sundries in the room(a,b,c,d,e), they cannot be put into the 2x2 matrix, so we put them in the 3x3 matrix, output should be:
[
["a","b","c"," "," "],
["d","e"," "," "," "],
[" "," "," "," "," "],
[" "," "," "," "," "],
[" "," "," "," "," "]
]
For more example see the testcases.
Series:
- Bug in Apple
- Father and Son
- Jumping Dutch act
- Planting Trees
- Give me the equation
- Find the murderer
- Reading a Book
- Eat watermelon
- Special factor
- Guess the Hat
- Symmetric Sort
- Are they symmetrical?
- Max Value
- Trypophobia
- Virus in Apple
- Balance Attraction
- Remove screws I
- Remove screws II
- Regular expression compression
- Collatz Array(Split or merge)
- Tidy up the room
- Waiting for a Bus
Puzzles
Games
Similar Kata:
Stats:
Created | Apr 5, 2016 |
Published | Apr 5, 2016 |
Warriors Trained | 270 |
Total Skips | 11 |
Total Code Submissions | 624 |
Total Times Completed | 129 |
JavaScript Completions | 129 |
Total Stars | 10 |
% of votes with a positive feedback rating | 93% of 60 |
Total "Very Satisfied" Votes | 53 |
Total "Somewhat Satisfied" Votes | 6 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 7 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |