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

Stats:

CreatedNov 20, 2014
Warriors Trained3210
Total Skips588
Total Code Submissions4508
Total Times Completed1275
Python Completions471
JavaScript Completions547
Ruby Completions213
Haskell Completions66
Total Stars38
% of votes with a positive feedback rating91% of 280
Total "Very Satisfied" Votes242
Total "Somewhat Satisfied" Votes26
Total "Not Satisfied" Votes12
Total Rank Assessments282
Average Assessed Rank
6 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Idwell Avatar
  • jhoffner Avatar
  • bkaes Avatar
  • GiacomoSorbi Avatar
  • mmalkavian Avatar
  • Voile Avatar
  • cliffstamp Avatar
  • Y_Priscilla Avatar
Ad