Ad
  • Custom User Avatar
  • Custom User Avatar

    That's not one of the basic tests, copy/paste it to sample tests to see your code fail and debug it.

  • Custom User Avatar

    Your code is wrong, not a kata issue. It fails tests like this one:

    testing(longest_consec(["zone", "abigail", "theta", "abigail", "form", "libe", "zas"], 2), "abigailtheta")
    
  • Default User Avatar

    The code in PyCharm gives you the correct result, but in the tests it is not correct. What could be the error?
    print(longest_consec(['ahhhyaann', 'xxpppojta', 'ttiicccxnnnzz', 'eeeraafnbbddqii', 'jwwwsppc', 'uubddy', 'vvvaaaamww', 'zzzhbee', 'yybbbcjjqqqqq', 'kkyygnnn', 'oonghhh', 'vessh', 'ttllae', 'bbbqqqegggm', 'uxfffxxcuuurrrhh', 'ufrrrvvvnfffx', 'bbhhhnnn', 'lllcccekaa', 'zzqqquuugggpaaa', 'zzeeewwuuuvv', 'kkkuujqq', 'diiigggooo', 'rrruuuiiyyoooaaakkiiwww', 'qqdddhhbbuuu', 'cbvvqqqgggee', 'aaaveee', 'zzfffnnnrnoo', 'tttaaauupssswfff', 'nnnnllled', 'jaaaennnyyp', 'llljuuhhhww', 'wwzzzmmmk', 'swwwjjn', 'ccnnnqqqfffoooko', 'obbkkxxddd', 'qlluujjcccjssseeep', 'aamjj', 'aaarrrmmmbhh', 'brrrdvvc', 'mmmtuu', 'fffssnnneuuq', 'rrtttv', 'ggtbbbttooh', 'nnnwwtttlfff', 'ppttttwaaa', 'fnntccckllttt', 'ggooouppp', 'vvhhhdddso', 'xxxnnooqqfjjj', 'cztf', 'fffuubbbb', 'crrrnn', 'sswfooff', 'jjjgggkktttaxxoozz', 'llttyy', 'ymln', 'kkggyyygvvvvvf', 'hhfffimmmvvvsss', 'xjjjkyfqq', 'jyyssddlla', 'hhhrzzzttt', 'eewwbeeq', 'xxfffccbpvvvu', 'ffvvvggggggvf', 'ffofffdddvvqq', 'ffxpppssstttl', 'yyymmkkkzziii', 'ygga', 'feetttcc', 'rrrjdddzqqqfgg', 'vvvssuuuj', 'ssbbbccqkk', 'sazzzvvrrrexbb', 'kkwwwrycs', 'fiyyyaaa', 'sbbbpp', 'oooeeennnoo', 'uuuuuqqqw', 'ndddqqqkh', 'qqqoorm', 'kenncccllqqtx', 'kcccellljsslll', 'qvvvvmmmee', 'eeennnqqqnmmm', 'eovgkkkhhh', 'mnnnkkaaa', 'hhhlbbeeepppw', 'qqqaabbbpppht', 'iicd', 'kkiikj', 'riiii', 'fffoccclwee', 'xxdxxzzzkkzzz', 'hhhccuweeekkk', 'zzzoobbfffllj', 'jkkkggg', 'dvuu', 'iibffwwll', 'yyvff', 'ahhiiipppqqq', 'zzppcccffcchhmmmm', 'wwwxxxpppnnnbyyy', 'ppnnniyyfffn', 'qqzziiu', 'xxxmmmvnnnoww', 'yyzxxl', 'bbjwwtttdp', 'cccnefooojttt', 'mppps', 'mmaasaa', 'wwweeezkqqqo', 'unnoddttt', 'kkjjjcccaaayyy', 'qqehhn', 'rryyjjjfgggvvv', 'gxi', 'pppbbbssjh', 'xiddddhh', 'eeotttfffcc', 'kkkjhooovvvvv', 'qfcccvvvjjj', 'xxxqcjjjummooo', 'reyyy', 'fooeeesssw', 'ttrrpppeyyy', 'hhhdddmmmgnn', 'hrnyyyyttz', 'ddqqaayyyyy', 'hhvaaawwnnnooo', 'ccsskkkuu', 'aaffqqhssjjjjp', 'leeeraaabbkkk', 'vvvyyshhhssse', 'fzzmmmfff', 'fvooyyygbbdnppp', 'hhsssdddhhh', 'pjjjccclllsss', 'yyydddaaauuubbrrrvv', 'xxxrrn', 'lllzzzxxooqqa', 'yyyvyyyr'], 17))

    uxfffxxcuuurrrhhufrrrvvvnfffxbbhhhnnnlllcccekaazzqqquuugggpaaazzeeewwuuuvvkkkuujqqdiiigggooorrruuuiiyyoooaaakkiiwwwqqdddhhbbuuucbvvqqqgggeeaaaveeezzfffnnnrnootttaaauupssswfffnnnnllledjaaaennnyypllljuuhhhww

  • Custom User Avatar

    Good kata though my solution is too long compare to others , i felt stupid LOL

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

    Ohh okay thanks for explanation. I'll try to figure out again. thanks

  • Custom User Avatar

    You can't convert an array to null. You can return whatever you want, if your array doesn't contain something correct, just return nul. Or better, try to catch when you should return null and leave the array.

  • Custom User Avatar

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

  • Custom User Avatar

    Because your function returns [NaN, NaN, NaN] when it should return null.

  • Custom User Avatar

    Why i got [Nan,Nan,Nan] instead of 'null'?

    This one is hard for me

  • Loading more items...