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 comment is hidden because it contains spoiler information about the solution
happy it helped
Does some sort of "console.log" work on codewars for SQL?
I tried PRINT and RAISE NOTICE but doesn't seem to work at least for this,
or I haven't used them properly...
This comment is hidden because it contains spoiler information about the solution
Good morning to me! :D So I didn't realised about the parentheses on i+1, in that form it uses to pwr the i not the i+1. Solved thanks.
I think initially I had something like : tot + (Number(v) ** i+1) in the reduce method. I don't understand why this doesn't work. I'm pretty sure it's my bad anyway :P
gg ez!
something was weird about the Exponentiation( ** ) while trying to solve this.
When I used math.Pow() my solution worked but when I used Exponentiation it gave me the same result over and over again. For example I used the expo( ** ) for power 1 and I got answer 2 no matter what number I had, like 5 ** 1 = 2, 6 ** 1 = 2. Then after a long time of trying to figure out, I just changed to math.Pow(5, 1) = 5 and there you go...
Was it something wrong I did? Or it just doesn't work to be used this way?
Coudln't figure it out after a 1-2 hrs evening, very tricky
Especially after trying a lot of things on your own, is good to check google as well from time to time :)
It's written in the instructions: "NOTE on performance: There are no fancy optimizations required, but still the most trivial solutions might time out. Numbers go up to 2^31 (or similar, depends on language version). Looping all the way up to n, or n/2, will be too slow."
It says basically that there are huge numbers so you need to optimise your code to run faster. If you check every number, or only half of them it will fail.
A wise man once said:
"Your training to master the ancient forgotten art of programming like a boss will be complete only when you succesfully solve and understand all of g964's katas" XD XD XD
This comment is hidden because it contains spoiler information about the solution
Does this work? I get 'Function should match the full passed criteria.: expected true to equal false'. I have no idea what's the problem, the tests are not that great...
Awesome kata!
Loading more items...