Ad
  • Custom User Avatar

    Correct the description please,
    nextPal(191) == 292
    should be
    nextPal(191) == 202

    Thanks!

  • Custom User Avatar

    Nice one!
    There's typo in the description, you missed a "4" in the array (should be three "4"s instead fo two).

    [1,4,4,0,4,3,3,1] # should return [1,12,0,4,6,1]

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Clean and elegant solution.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    It seems that there are no test-cases for checking unique values on columns.

    Could you please add some?

  • Custom User Avatar

    I get your point. For the purpose of this kata, what would you do to improve it?

    Thanks!

  • Custom User Avatar

    Hello guys,

    @xcthulhu, nice kata!
    But could you please explain this part? add_ = defaultArguments(add_,{b:3, a:2});

    I'm having some trouble in understanding why add_ is being called here.
    Am I supposed to extract the callback from a previously declared variable?

    Thanks!

  • Custom User Avatar
  • Custom User Avatar

    You are absolutely right, thank you!

    The kata is updated as such: it should return true/false, nothing else.

  • Custom User Avatar

    Hello,

    Thanks for your review, just rechecked my old solution and it did not pass (strange :) )
    Seems like some test cases were incorrect, but now they are updated.

    I'm comparing the result this way,
    if it should return true, then -- Test.assertEquals(results1.hasJuice(240, 210, {extra:3, minutes:9}).true, 1), where 1 is the value of true, eg {true:1}
    if it should return false, then -- Test.assertEquals(results1.hasJuice(240, 330, {extra:3, minutes:9}), false)

    Am I getting this wrong?

    Thanks,
    Michael

  • Custom User Avatar

    Hello, I see your solution returns undefined (using the example tests).

    Try defining the extra() method outside of hasJuice. It works for me.

  • Custom User Avatar

    I'm leaving town, and I need my phone to have enough battery to last needFor minutes. I will be speaking/playing on it for activeUse minutes. Of course, battery is still consumed (as idle time), whether I'm speaking/playing or not, but idle time consumes much less battery than activeUse.
    If activeUse is greater than needFor, then the solution should definitely return false.

  • Loading more items...