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.
metoo
You need to create a function
solution(number)
wich returns the sum of every0 < n < number
such thatn
is multiple of 3 or 5.For example,
solution(10)
Multiples of 3 that are
< 10
: 3, 6, 9Multiples of 5 that are
< 10
: 5Result: 3+6+9+5 = 23
So
solution(10) returns 23
.I'd recommend a site like HackerRank.com. It's kinda like Codewars, but a little more organised and curated. It's got a great Algorithms section with tasks ordered by difficult, in different sections you can tackle at your own pace.
As for Algebra, you can take a look at KhanAcademy.com. It has a ton of topics other than maths, but the maths section is particularly full. You can watch explanation videos and take mini tests as you go, to make sure you've understood what you just learned.
Hope those help. Any other non-code-specific questions, feel free to catch me on G+. You can make a post that's only visible to me, which is the easiest way. I would give you my email address, but only if you could see it quickly and I could take it down immedaitely afterwards. With a private post on G+ I wouldn't have to worry. ;D
This comment is hidden because it contains spoiler information about the solution
Do you remember what fixed it for you? I'm getting stuck on the last case too
It doesn't pass because you convert the whole string to lowercase and then return the lowercase character.
As I mentioned above, you need to keep at least one copy of the original string in order to return the actual character instead of lowercase one.
Your filter is correct, but for a string like "aTA" it will return "t" instead of "T" because you return the converted character.
While lower and uppercase characters should be treated as equal you still have to return characters in their original case.
Thus, you can make a copy of the characters in lowercase without modifying the original string, so you always know what the real character was.
If you are still having problems with it, post your code here.
You can convert the strings you are trying to match to lower case first and then compare them.
Of course, you can do the same with converting them to uppercase first.
The methods are String.prototype.toLowerCase and String.prototype.toUpperCase.
It's due to very few test cases. So, yeah, it's a bug in the kata.
Unfortunately, Katas which have more than 500 submissions cannot have their test cases edited by anyone except the moderators.
Leave the issue open for now. Someone will fix this sooner or later.
A few pointers, since you asked. Your indentation is all over the place. Most Node programmers use two spaces for a single level of indentation, and you have two in some places, four in other places, and your closing brackets don't match either K&R style or Allman style formatting Wikipedia: Indent Styles.
In terms of the logic in your code, you're calculating the same slope 4 times, once for each argument, which is unnecessary. If you want to check that all the parameters are legitimate, you should do that in a separate loop (it's not required in the problem description, but it's not a bad idea). You also don't need to be concatenating values onto your result string. There's a fair amount of "dead code" here. Take a look at some of the other solutions to see what most people consider "best practices."