Draft
Replace multiples with string
471 of 1,275Idwell
Description:
In this Kata you need to will need to write two methods.
Method 1
The first method takes in a valid int (positive or negative) and returns the following:
- for any multiple of 3 the string "THREE",
- for any multiple of 5 the string "FIVE",
- for any multiple of both the string "BOTH",
- for all other numbers the original int.
Method 2
The second method takes two integers (a
and b
) as inputs and returns an array which is the result of the above method applied to each value in range from a
to b
.
Note the inputs can be negative, and the first value may be greater than or less than the second and the list should increment/decrement appropriately
For example an input of 10,13 should generate a response of ['FIVE', 11, 'THREE', 13].
Remarks
Similar Kata:
Stats:
Created | Nov 20, 2014 |
Warriors Trained | 3210 |
Total Skips | 588 |
Total Code Submissions | 4508 |
Total Times Completed | 1275 |
Python Completions | 471 |
JavaScript Completions | 547 |
Ruby Completions | 213 |
Haskell Completions | 66 |
Total Stars | 38 |
% of votes with a positive feedback rating | 91% of 280 |
Total "Very Satisfied" Votes | 242 |
Total "Somewhat Satisfied" Votes | 26 |
Total "Not Satisfied" Votes | 12 |
Total Rank Assessments | 282 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |