Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This solution is erroneous (based on both the nested for loops and final if/else statement on the ascCount and descCount.
ascCount and descCount can be equal and also be in an unsorted array.
Similarly, the if/else statement is therefore faulty based on the faulty counters.
Revised solution works out all edge cases.
THIS reply is what helped me figure out what this question was asking, lolz.
To further explain, these are some of the tests given:
sumMul(n, m)
sumMul(2,9) should return 20
sumMul(3,13) should return 30
We are looking for the sum of all the multiples of n up till the max value m.
ex1) sumMul(2,9) should return 20
multiples of 2 that are less than 9 = 2,4,6,8
the summation of those numbers is 20
ex2) sumMul(3,13) should return 30
multiples of 3 that are less than 13 = 3,6,9,12
the summation of those numbers is 30
And so on.