Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Clever exploitation of the fact that our data consists purely of small integers!

    I wish numpy had a argpartition for 2-keys. lexsort comes close, but it's a full-fledged sort and has the annoying additional requirement of named arrays. Which makes my solution look... uglier than otherwise.

  • Hey dke! I wonder what does this mean "yes it is possible - Expected: true, instead got: false"

    I get this warning but I can'T see for which test case it did not pass. Is it normal to not see the test case? My function passes many cases but not the some of edgy ones, I would like to see how edgy they are :)

  • Added.

  • Sample tests are still using Test.expect.

  • Got it did it! thanks i hadn't thought about this problem wow...

  • Removed 'the hard code' thanks :)

  • that seems quite reasonable gonna do it

  • Thanks for saving me from future troubles...

  • Fixed some typos and reworded a bit.

  • although i thought it would be a another challenge for new-comers to trucate instead of just rounding to some decimal places (rounding is easy). anyway if you say i will do that... althought i was forgotten while traslating that into python, now the snake is back hope you feel good. :)

  • Please do not round ( or truncate ) floating point values. Compare with a margin for error ( assertApproxEquals in JS ).

    If I get 10.00039999999999999999 instead of 10.000400000000000001, I'm still screwed. Rounding instead of truncating just moves this problem by 5e-something.

    NB: Math.hypot gives different answers than Math.sqrt.

  • Sorry, it's a duplicate of Bug's life: https://www.codewars.com/kata/bugs-life
    Good attempt. Continue trying and you'll be publishing good katas in a short time.

    • use snake_case for python function naming, not PascalCase.

    And why the fuck the rounding? That leads to situations like this:

     Basic Tests
    10.8167 should equal 10.8166
    Test Passed
    Test Passed
    Completed in 0.12ms
    Random Tests
    Length = 524, Breadth = 902 and Height = 386
    1281.29 should equal 1281.2899
    Completed in 0.03ms
    Length = 133, Breadth = 863 and Height = 806
    1275.3392 should equal 1275.3391
    Completed in 0.02ms
    Length = 117, Breadth = 639 and Height = 382
    810.754 should equal 810.7539
    

    To avoid float point comparison truncate the result to 4

    -> just... "lol!" x/

    => Use proper float testing: Test.assert_approx_equals(act,exp,precision)

  • sorry i wasn't knowing it lets see. thanks for making it easy for me to check out the problem with retired kata and and be very specific in that area

  • Seems familiar... https://www.codewars.com/kata/5b6c9d3b83b7636f6b000142/

    (But that got retired - maybe you will have more luck with it than the last guy)

  • Loading more items...