Ad
  • Custom User Avatar

    [This is for Javascript]
    Can I get some help here? It keeps failing on random test cases, I think my result is right.
    If not, could i get an explanation? Because even in my head - if i manually try and do it, that's how it should be.
    E.g
    Battlefield: rbpl[l]#m[cwd]bzu[pvx]###[tq]on expected 'l' to equal 'lcwd'

    Battlefield breakdown:
    rbpl[l]#m[cwd]bzu[pvx]###[tq]on
    [l]#[cwd][pvx]###[tq]
    [l]#[cwd][pvx]###[tq]
    [l cwd ][pvx]###[tq]
    [l cwd ][pvx##tq]
    [l cwd ]pvx#tq
    l

    Likewise, as someone else in the comment section - I ran this:
    Testing for [flrxgj][eyadcb]s#sgryedufaxwzegqeezrjcirqaoce#dcaigasncuemtphwijoyuroa[gdlmvrsj]pacjkssikw Expected: "flrxgjeyadcbgdlmvrsj", instead got: "flrxgj"

    Additional Random Tests:
    Battlefield: nqt[pav]d#[k]pu[qv]#[vyp]#d[dw]##
    [pav]#[k][qv]#[vyp]#[dw]##
    [pav]#[k][qv]#[vyp]#[dw]##
    [pavk][qv]#[vyp]#[dw]##
    [pavk][qvvyp]#[dw]##
    [pavk][qvvypdw]##
    [pavk][qvvypdw#`

    expected 'pavk' to equal 'pavkqv'

  • Custom User Avatar

    Correct, it should be
    [ '1/2',
    '1/7',
    '1/59',
    '1/5163',
    '1/53307975',
    '1/9007199254740992' ]

    Above is wrong because javascript makes issues in its math calculation. Best to round each of your answers then do calculation.

  • Custom User Avatar

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

  • Custom User Avatar

    Idk you are definitely getting better cause i struggled big time with this. But mainly because I went through so many different solutions, wasting time and stuff; the trick here was i expected everything to be sorted.
    In the end, pulled out the good ol' sort algorithms, and finished it in 30mins. I should say my solutions are always super unique to everyone elses.

  • Custom User Avatar

    This felt harder than any problems i solved so far :x - and i did some 4kyu problems.
    But was hella fun!
    Great kata

  • Custom User Avatar

    wow this eloquent coding completely destroys my trash behemoth of a code. (;´༎ຶٹ༎ຶ`)

  • Custom User Avatar

    well.. this was way easier than i made it ought to be initially.
    Some other people's solutions though, doing in a liner -
    :weary: I want to do that one day