Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This is my fault. I forgot that parseInt takes a second parameter which completely changes the behavior. It should be fixed now.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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 runsseq.some(x=>pred(x))
or something to the effect oflet 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?
This comment is hidden because it contains spoiler information about the solution
hahaha, bro took the role of god to a whole new level
This comment is hidden because it contains spoiler information about the solution