5 kyu
String -> N iterations -> String
212 of 806Jomopipi
Description:
Welcome
This kata is inspired by This Kata
We have a string s
We have a number n
Here is a function that takes your string, concatenates the even-indexed chars to the front, odd-indexed chars to the back.
Examples
s = "Wow Example!"
result = "WwEapeo xml!"
s = "I'm JomoPipi"
result = "ImJm ii' ooPp"
The Task:
return the result of the string after applying the function to it n times.
example where s = "qwertyuio" and n = 2:
after 1 iteration s = "qetuowryi"
after 2 iterations s = "qtorieuwy"
return "qtorieuwy"
Note
there's a lot of tests, big strings, and n is greater than a billion
so be ready to optimize.
after doing this: do it's best friend!
Check out my other kata!
String -> N iterations -> String
String -> X iterations -> String
Strings
Algorithms
Puzzles
Similar Kata:
Stats:
Created | Apr 28, 2018 |
Published | Apr 28, 2018 |
Warriors Trained | 3216 |
Total Skips | 140 |
Total Code Submissions | 9413 |
Total Times Completed | 806 |
Java Completions | 212 |
C# Completions | 101 |
Python Completions | 484 |
Ruby Completions | 26 |
Go Completions | 19 |
Total Stars | 157 |
% of votes with a positive feedback rating | 95% of 172 |
Total "Very Satisfied" Votes | 155 |
Total "Somewhat Satisfied" Votes | 16 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 4 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |