Ad
  • Default User Avatar

    The problems here is to avoid loops by finding a formula (or more) that can get the job done quickly. I managed to find a crappy solution but still with one loop (hovewer I saw some solutions with zero loops at all). By typing the inputs of the kata on oeis.org it will return different algorythm with all kind of details. By looking at all this informations and (tinkering a lot) you may find some insight to solves this kata. (Also, leaving the keyborg and using some pencil and paper help me a lot for the tinkering part.)

  • Default User Avatar

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

  • Default User Avatar

    I run python 3.6.1 and I didn't noticed I could change the python's version on codewars. So I changed it to 3.6 and now my code works.
    Thanks @rowcased for the input.

  • Default User Avatar

    On my side, my code work fine for all the attempts: I get the (categorie : number) in the given categories order. But when I tried on codewars, the ouput is randomized. Weird.

  • Default User Avatar

    I finally found a solution (one fking year later). Thanks for the oeis.org link it help and I think it will definitely help even more in the future.

  • Default User Avatar

    Well I didn't though that my solution could be qualified as 'brute force' ...
    You are telling me that a math pattern will allow me to avoid the double loop ?

  • Default User Avatar

    I found that one condition (check if superior to 0) was unnecessary. Still too long to process ...

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    I didn't understand this, thanks.

  • Default User Avatar

    I'm a bit lost with this new information. The first sample suggest otherwise :

    before = "CCC[CCC]FCC[CCCCC]CFFFF[CCC]FFFF"
    after  = "...[CCC]F..[CCCCC].FFFF[CCC]FFFF"
    

    There isn't any fox in the first pack but in the end all the chicken are gone.

  • Default User Avatar

    Oh My Glob ! That was so obvious.

    Thank a lot for your suppor and happy baguette :)

  • Default User Avatar

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

  • Default User Avatar

    I am aware of the many guy who pass without problems (27 with python) BUT maybe my solution is kind of original ... (probably not the most efficient)

    I think the spin2 is always wrong with the random test but somehow I can pass some of them (probably luck). But, I'm repeating myself, I've errors in Codewars but not in PyCharm.

    And I think we are on the same side of the world (It's also midnight for me ;))

  • Default User Avatar

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

  • Loading more items...