Yep, that's a precision problems. Try finding precise representations of your numbers (e.g. "e" constant has a precise and a less precise expression in many languages).

I've implemented what i've read in wikipedia (https://en.wikipedia.org/wiki/Derangement) but for the sample test (array length = 30) I get
97581073836835790093775590653952 should equal
97581073836835777732377428235481

I pass 8 of the 350 tests for array length up to 18. And after length 170 I return inf...
Aaaand the numbers I return for length between 18 and 170 are wrong.

Yep, that's a precision problems. Try finding precise representations of your numbers (e.g. "e" constant has a precise and a less precise expression in many languages).

I've implemented what i've read in wikipedia (https://en.wikipedia.org/wiki/Derangement) but for the sample test (array length = 30) I get

97581073836835790093775590653952 should equal

97581073836835777732377428235481

I pass 8 of the 350 tests for array length up to 18. And after length 170 I return inf...

Aaaand the numbers I return for length between 18 and 170 are wrong.

Any ideas?

@xen0f0n

,BroYour Kind Words Made my dayHope you all the best.. Regrds ..Zizou@MrZizoScream

Hey there! I really enjoyed the whole collection

https://www.codewars.com/collections/playing-with-lists-slash-arrays

Keep up the good work!

Regards, Xenofon

@xen0f0n

as WellMaximum Triplet Sum , Transform to prime , Row WeightsHappy To Follow you.. Wish you all the Best On/Off CW .. Regards ..BroZizou