• doublestopcommented on "Last digit of a huge number" kata

I am sure this has probably been brought up before... but You CAN do the calculation with a calculator... it's not an unreasonably large number. The numerical value of this argument: ([4, 3, 6] comes out to 68719476736. That expected result should be 6. Why is this Kata's expected ouput wrong?
" ([4, 3, 6], 4)) .

• doublestopcommented on "Last digit of a huge number" kata

I have gone round and round about this question. It's an interesting Mathematical question ( to my mind) ! All logical paths I take... the answer should be 0. How can "nothing" end up as 1 when multiplying zero by itself? Seems like you are getting something for nothing! But all feedback I see, indicate that in pure mathematics 0^0 is an "Indeterminate quantity". Computer's just default to one, since it is easier to calculate with 1 instead of zero. Personally I think the question is a fascinating existential question.... and it makes me contemplate the weirdness of Quantum Mechanics... and the phenomenon that empty space in a vacuum is not "empty".

• wing92518commented on "Last digit of a huge number" kata

Is there any hint about how to solve the question?
I am still thinking that for example if the first elements contains 0 but not exactly zero, the result should return 0.

• hobovskycommented on "Last digit of a huge number" kata

Are these not nested lists?

You're reading the code of tests wrong. What you see there is a list of test cases, where each test case is a tuple of (input_list, expected). If you read tests further, you see:

for test_input, test_output in test_data:
test.assert_equals(last_digit(test_input), test_output)

You can see that the call looks like: last_digit(test_input), where test_input is a single, flat list. One list from the whole test set, one by one.

• doublestopcommented on "Last digit of a huge number" kata

In the kata description it says this: E. g., with the input [3, 4, 2], your code should return 1 because 3 ^ (4 ^ 2) = 3 ^ 16 = 43046721.

that looks like a list to me! It did not mention anything about arguments being in the form of both lists or lists within tuples ! why was this information left out?

• AFireInside777commented on "Last digit of a huge number" kata

The above picture you posted is not at all nested lists. More like tuples that have lists in them.

• doublestopcommented on "Last digit of a huge number" kata

No matter what I do to handle this (I used a recursive function to "flatten" the list), but no matter waht I do, I cannot get ([0,0,0],0) to return the expected 0. It always returns a 1.

• doublestopcommented on "Last digit of a huge number" kata

Are these not nested lists? The arements have arrays within the lists! lists within lists.

test_data = [
([], 1),
([0, 0], 1),
([0, 0, 0], 0),
([1, 2], 1),
([3, 4, 5], 1),
([4, 3, 6], 4),
([7, 6, 21], 1),
([12, 30, 21], 6),
([2, 2, 2, 0], 4),
([937640, 767456, 981242], 0),
([123232, 694022, 140249], 6),
([499942, 898102, 846073], 6)

• hobovskycommented on "Last digit of a huge number" kata

What do you mean, "arguments that hare nested lists"? There should be no nested lists anywhere. Why do you think that you are given nested lists as inputs?

• doublestopcommented on "Last digit of a huge number" kata

My comment on this kata is that the description is a little mis-leading! Nowhere in the description does it mention that testing will include arguments that hare nested lists! Therefore my current solution gets errors. Does this solution require recursion?

• iguanaigicommented on "Last digit of a huge number" kata

I don't think modular arithmetics is basic math, but I guess that is a matter of perceptioin.

• coding_forestcommented on "Last digit of a huge number" kata

No, parentheses are very important in this situation and in our case we start from the bottom to the top not from the top to the bottom.

• metatablecreated a suggestion for "Last digit of a huge number" kata

Lua translation! (author inactive)

• Mednoobcommented on "Last digit of a huge number" kata

There's no tests with [7,8,1] as input in javascript.

Even if it's generated by random test, the reference solution returned 1. Which is correct.

You sure that's from the tests? I can only see [7,6,1] which indeed should return 9. Try resetting your editor / trainer.

• J4kedicommented on "Last digit of a huge number" kata

[ 7, 8, 1 ]
[ 7, 9, 3, 1 ]