Ad
  • Custom User Avatar

    Nested loops are what cause the O(n^2) behavior!

    I suggest looking up "memoization" and seeing if that coding practice can help eliminate the need to do multiple passes over the list in question. :)

  • Custom User Avatar

    I get an error on ~1.86M, so it is bigger then 1.5M

  • Custom User Avatar

    It's 2M if you are lucky.

  • Custom User Avatar

    Why would one except that negative n has to produce negative results? How does it fit the definition of Fibonacci numbers?

    Theres a hint at the bottom which points to a hint on calculation of terms with negative indices.

  • Custom User Avatar

    For python it's ~1.5 mil, don't know about JS (probably similar)

  • Custom User Avatar

    fib 1859772
    Execution Timed Out (12000 ms)

    What is the biggest number in the tests?

  • Default User Avatar

    you are possibly printing a lot. if so, silence the print statements and try again

  • Custom User Avatar

    Program is throwing error:

    Max Buffer Size Reached (1.5 MiB)

    Last attempt of array ([13,3,1,1,1,1,1,1,1,1,1,1,1,1...] , 13) does not complete;

  • Default User Avatar

    me too!

  • Custom User Avatar

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

  • Default User Avatar

    Hi awesomead, I have made a change that should fix everything. Please try again when you get a chance, thanks.

  • Default User Avatar
  • Custom User Avatar

    Thank you very much for your quick response. I had written that part and when I wanted to rewrite it, I just deleted without writing it new.
    So I thought I considered everything and it seems that then my frustration made me blind.
    Now it works!

  • Default User Avatar
    * a valid response word must contain four different letters
    
  • Custom User Avatar

    Hello, I just wanted to ask how trustworthy are the tests in JavaScript?
    More than one time I've seen tests like the one beneath.
    Alice has no valid word in her memory, however Bob does - namely heme.
    My code finds this word and therefore the winner is 1 (Bob). The test however claims that -1 is the correct result.
    Either the tests are heavily unreliable or i misunderstood the Kata completely.

    Thanks for help in advance!

    Start word: home
    Starting person: Alice
    Expected result: -1
    
    Alice: spat,hale,tail,byre,poco,beet,ekes,horn,leis,mows,adze,gaol,thro,dirt,veto,bars,fuds,limn,dyad,pily,sard,floe,coda,quad,hilt,purl,feta,wiki,near,pois,loll,wool,joke,hawk,vaws,pith,mack,vail,ohed,opah,jure,tala,flow,tups,club,koan,staw,taus,west,hail,eats,reds,roam,tuba,acne,kirk,burb,pews,hang,culm,rows,rasp,impi,jour,uvea,isle,doms,exit,pogy,scow,anga,ludo,gist,kolo,tody,cote,slue,rath,maps,pave,ware,gyri,echt,bedu,ween,baps,fore,raws,typo,rhos,bent,vatu,urea,loto,sagy,mise,anon,sari,smug,nill
    Bob: safe,pias,last,tray,tort,culm,girn,aims,nays,cuif,teds,bent,wive,eide,goos,halo,cans,blae,nite,kist,bozo,bawl,pion,sods,muns,bitt,molt,lime,jamb,mote,bins,frug,froe,yowl,huck,apes,jogs,rhus,tonk,geek,oink,efts,boar,bind,mope,eche,orcs,bend,tyre,heme,gunk,whys,desk,duro,bean,foss,bogs,inly,wham,peen,floc,meno,mell,roti,haen,samp,eyry,hoya,fine,suit,fume,dojo,waft,alky,tret,cars,lean,sack,pool,abut,same,odes,yang,undy,list,lite,heir,nosy,bole,tegs,fehs,grum,lipe,pang,tike,tick,kaes,lade,gadi,luny
    
  • Loading more items...