Ad
  • Custom User Avatar

    Chill bro, no need to be harsh.

  • Custom User Avatar

    You do know how to answer a question without being a dick, don't you?

  • Custom User Avatar

    Do you know what odd numbers are, don't you? The dashes separate them:

    454793
       79
        93
    4547-9-3    
    

    7 and 9 and 9 and 3 are the only pairs of odd numbers next to each other there.

  • Custom User Avatar

    "...Write a function insert_dash(num) / insertDash(num) / InsertDash(int num) that will insert dashes ('-') between each two odd numbers in num. For example: if num is 454793 the output should be 4547-9-3. Don't count zero as an odd number..."

    Why not 45-4793? Or 45-47-9-3? etc

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

    Your scores are not correct. I think I made the same mistake in my first solution; just pay more attention.

  • Custom User Avatar

    On the random tests, the very last test fails consistently so am looking for some help/pointers.
    Consider this random test string:

    "mntznaesr swairiyjmk rtdabu ujbdwexulp otvk trtuzgkuat nuhpcwyg lfeefwxab clwjbwr iikxtazs dxlchvwfr vxotlonry dmjwt"

    according to the test then 'trtuzgkuat' (score=155) is the max word despite the fact that 'vxotlonry' (156) is the max word.

    Similarly with the following word string:

    "pkfever cqehicl dfkywqa rkipisr zssov rtbkzh xppehierj spdkzta usrkx txdmzsw kczatzvk umvmj yltrncbou oliradka qjdi ywxi uaxcrhyli"

    the test states that 'yltrncbou' (121) is the max word when 'txdmzsw' (122) has the max value.

    So, anyone else had this problem? Or got any tips/pointers as to the resolution.

    Thanks!

  • Custom User Avatar
    def duplicate_encode(word):
        print(word)
    

    That.

  • Custom User Avatar

    Sorry? "print the input to the console" ?

  • Custom User Avatar

    Just print the input to the console

  • Custom User Avatar

    Hi,
    I can run the Sample tests fine and all four pass but when I try the "Attempt" tests then all but the last test passes, and gives me an error:

    '))(()())())' should equal '()(((())())'

    Is there a way to see what the actual test case is? This is only my 2nd day on Codewars so am still getting settled in.
    I can then debug my code as needed.

    Thanks!

    Gary