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.
Submission tests show you what was the failing array:
Example tests do not show the array, but you can see the code of the exampel tests, you can modify it at will, so you have everything what's needed to figure out which assertion is failing.
Your code using
Math.Pow
has no chance to work. It will lose precision very quickly and give inaccurate result. Alsonum.ToString()
called on a largedouble
will not work in an expected way.You need a uch better idea, and for sure one which does not use floatign point numbers.
You can always see what test goes wrong by doing
Console.WriteLine(arr)
.in C#, the tests are all in one attempt
Test Failed
Assert.That(Calculator.LastDigit(allCases[i].test), Is.EqualTo(allCases[i].expect))
Expected: 1
But was: 0
this means I can't see which test I got wrong, which makes it hard to figure out how to solve the code.
Not a kata issue. Closing.
Strictly a mathematical challenge more or less.
Thanks! That was very helpful.
19th test is
[2,2,101,2]
and the last digit is 6: https://www.wolframalpha.com/input?i=2%5E2%5E101%5E2You can print the input array to see what tests pass to your solution.
I'm stuck. My Python solution passes 635 tests, fails on one. It fails on the 19th Basic Test, the only feedback is '4 should equal 6'. Is it possible to see what that test is so that I can work out what's going on?
I apologize, I was really wrong, it's a pity that I realized very late.
How can you say that it should be 4? Have you calculated it manually?
It should be 6, see this: https://www.wolframalpha.com/input?i=2%5E%282%5E%28101%5E2%29%29
Not a kata issue.
why test 2,2,101,2 should be 6, when its 4 ? C++
0⁰
can be open to interpretation, but assuming it being 1 is not completely illogical: https://en.m.wikipedia.org/wiki/Zero_to_the_power_of_zeroAlso it does not have too much impact on this problem, it affect only very narrow, specific kind of cases.
This comment is hidden because it contains spoiler information about the solution
Exponentiation is right-associative.
Loading more items...