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

  • Default User Avatar

    Clean and elegant solution.

  • Default User Avatar
  • Default User Avatar
  • Default User Avatar

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

    Could you please add some?

  • Default User Avatar

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

    Thanks!

  • Default 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!

  • Default User Avatar
  • Default User Avatar

    You are absolutely right, thank you!

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

  • Default 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

  • Default 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.

  • Default 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...