Ad
  • Custom User Avatar

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

  • Custom User Avatar

    This is my fault. I forgot that parseInt takes a second parameter which completely changes the behavior. It should be fixed now.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    A'ight, this kata has me thrown for a loop. There are some tests that appear that yield one result on the master test, but seem as though they should fail the problem as described. It seems to come down to how Array.prototype.some behaves when handed parseInt?

    For example, one generated test:

    seq = [
    'JDQIAXYXUNBLWRAJSFXT',
    'D',
    'WCPXZDEGMLCRZ',
    'UYJMHZ',
    'XBIHTBFUBBNZLOXRGFFABJKJFPI',
    'TCNIIHVBFLOVXYG',
    'PNPOTCZUPVFVWGTL',
    'Z',
    'XGINIHEGSOEYMRASCEKRZ',
    '',
    '',
    'JDMJVCRJUGMXWN',
    'PMIJJEJKMIBB',
    'FXU',
    'PYPSHQLTROEUN',
    'KICOX',
    'GERISTWQWDGAFERQIIFXVGJ',
    'YWLJCSNAMZGLOXJLNLGHKVNDTEPY',
    'CQLIUPVRSMVTHQSCJJC',
    'XWBQHOSFAFI',
    'FA',
    'BIMKRIOHZCAG',
    'BMDBPDDHONJOAOVUIWHGFDO',
    'CMWFHNYFQQNWPBNNKSCDFDIRB',
    'AGCWIZYRHQCGQPYEGKIES',
    'TRAGUVGYJ',
    'LSJSLBF',
    'BLIQUGELZDQ',
    'AHOORDONNUQBYDDVI',
    'EDU',
    'SVALRMLJGV',
    'DFFLUMEJHIP',
    'YNUUEJN',
    'CNTYKGQRFWLHTB',
    'YO',
    'EFMVKHWLVMEJSZWW',
    'QKDWFTLQFBBCDUUAOIAV',
    'XBWSBFBAZIPPBWBJYTT',
    '',
    'SONQBBCCBBDMGD',
    'PYNLTD',
    'JUTSGTDJUZPFNCXJHICNWMH',
    '',
    'DC',
    'CUZST',
    'KSGPQILMASPYLDRSDJNCAI',
    'SKPYFUXQYLUQFDZYE',
    'LOZQUNTQMSGRR',
    'TBWPDTYBMLJSMVFPWNKNAQHMKUA',
    'AENVOGUUJNJRYHSQVFZ',
    'GIJRVCRRHGNDQWTXOGCA',
    'YZNO',
    'SCPMMBOFEFTIRAAKNBSH',
    'CPQNNP'
    ]

    pred = parseInt

    And the output of using this sequence is:

    seq.every(parseInt) == false
    seq.some(parseInt) == true
    seq.some(x=>parseInt(x)) == false

    So a solution that runs seq.some(pred) will get a different result than one that runs seq.some(x=>pred(x)) or something to the effect of

    let trueSeen = false;

    for(const x of seq) if(pred(x)) trueSeen=true;

    return trueSeen

    will also return false.

    Just at a glance, I'd expect false (every one of those strings yields NaN), yet the built in tools yield true.
    Can anyone tell me what I'm missing?

  • Custom User Avatar

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

  • Custom User Avatar

    hahaha, bro took the role of god to a whole new level

  • Default User Avatar

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