Ad
  • Custom User Avatar

    Please write an actual description instead of just linking to wikipedia.

  • Custom User Avatar

    Ruby should use RSpec assertions

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

    totally got stumped by an 8 kyu. dam

  • Custom User Avatar

    I can confirm the issue. The reference solution suffers from integer overflow in the comparison funciton it passes to qsort():

    int compareItemsByValue(const struct Item *lhs, const struct Item *rhs) {
      return lhs->value - rhs->value;
    }
    

    proposed fix here

  • Custom User Avatar

    C fork (author gone)

    • fixing the reference solution (cf. this issue)
    • the initial code now compiles
    • the input is now shown upon assertion failure
    • massively simplifying the tests suite (down from several hundreds of lines of code to ~80)
  • Custom User Avatar

    I don't know if the description has changed since the comment, but it clearly states now:

    The order of the sequence has to stay the same.

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks so much for this challenge! Really had fun with it. 🙌😊

  • Custom User Avatar

    I really enjoyed this challenge and tried solving it using a different approach.
    Thanks for the effort you put into creating it!

  • Custom User Avatar

    This error happens when, for example, you try to parseInt a string that's too long and wouldn't fit the datatype. You should find more info where the error came from if you follow the stack trace.

  • Custom User Avatar

    What is this?

    Random test:

    For input string: "2848416230228921695811616181553018617941642653111323971267807725663589418861175166981638982676859111702465927641192715498413481440802989439929709875344559167457434771796488595010843432271982314796186121826575218695405793151169545670342439218971861520343073567540636882937917338843696571254873921678624579485566728932118575233325234537918669497326695923771698583745683231939216804675737139361886598873963158894411339345217538415082168487198425537370394095729976369997988024207112434892267114884960113027369750471565884221304017436194441084845227499877534164125961627945465137535622989842403845382430122419808554886732457444397434765811571387839880773543121789774819172060174063268418585919601081701183458413676338923215266269476951988229974347284797831099314020246797652846767748663640679846668637396163787090784625657248326494668758514167856277413748287559141767857876583318471638462796987978345413971054451531923175273589164820931690825343507467401898288416246924696570873460175837489869266314901140931784802657896145497615422781282465923856747145939571387877248792556264479893378792939992248692466471934065762560722773259121473163666865408143314360869445331270338276737864819622236765204159427717202883266720749255306818223872996852737951994666679470312932958755271524258259121727286091743085807155187469237444783788261023209421458831653917632252585450125557109076534693551958269011731528383443227059225025526577651411383850456750769434155684653536681421863621643857738827696351983952853247132731577132822960185316431718798960139770402837978781161713632252175852664056411156912928625111103674452794654138321692175190373490894812264080186545322949942777346517976179929997956478729972823710661423267082437874756699888956444088485065335973323225902744508259394426885624318450995692311835611396248561632938782934402558223077607125873260105812867476457633198524663511149074386872889071315860704947663133753238185174531931195880436414207696294090187370985138621723817422619237847053249441849151231816115932213221642543399463873453323682607616989418985711292173713447911623277637218244779589659975347934963461551023668656384690376490345195501246505431555772212532499685301835979190865968632721528057577467766511577851756899382797334974276374467633725988951632159823574735182369724138456586688549233417167636998165948552938369834452282798916150985051842466514539533950227464793167187544821048781034304310677064485775432150117976394471637666613251405128186355171663428731364835374420827156286813127850111921138490448890606699881610549310951714113179817733653687688995603429409298108035508883137950919845922934495864802068617472772327743946622657147459519569458552966787254269458283102883611325178948672054569223943298371328272050982872243445659210885692206588289368824111891749966428641159485696482940308028756487848610851931352519656664293140506796767584289250759850172216362935346540976097799080819220689937562476112526807168106581328638465968908475572842458586438540429238558179836957428331549625354825878463284152734270988146421663412741237156282259982141509539289549256164505660371117748569862813654585756856591832183566916235548337401343877928428194152510339898538752937853716086966350904153493217432989295626179976541038473536866460831132221562148317147470579474982627452368373065574411457324381983105063515514951321427180575686736682348095502061716711242871169799969383287899508337809491528910947557757191554916665253531370739764781032875993343725796650622598618936846124463251657476381753987484357395873859523826181726806327358528375733739382892219701490711573663394979727801389269727318796463782658662909392291228796494449292917528817453564360108981907572441162415895765011929972467814201875685447645356273749496398286680293445519837643356776796549397123625513049791877709326876744535813544677284580172268938347998433425813943344953425593367455533341485744484126699965975998688359193693356899153898954455258101640442883652010541648255349458036213940541624435449198024976580834025504644358756435025753546194134664233313422603927383221986931389457828265607187232374229724156397825052816577361021921388504026661193324764562850309017885957918186152485707660464414776034447920544592619627321216735597156289725869399767674825421714652830636168156441737936761350213494659755508415266935137148191064724736961698847342284457266928779757411294116679537925686669506726613529456722384527682082743177449425687180454720165928265152693579921061632159483062884697994614441768626578987444818698742136957569212335826764798490758860"

  • Custom User Avatar

    Retired as a duplicate.

  • Custom User Avatar
  • Loading more items...