Ad
  • Default User Avatar

    Check the instruction again, it's been updated.

  • Custom User Avatar

    You have to find a minimum value in each row and sum that and then return the sum from the function

  • Default User Avatar

    A test result might look something like this:

    Actual: 319, Expected: 318
      String: "xttyh   ko  f rifsrgo zv lgxoftcojdweurme tdi w welzlhgtfiosiwues enrl o  cd iooounetigzihhmescqiuquaohc  pai n nbspae xw emlijqiqfiaynio gduf  uiqushoos jewullihauvwjin o j lheum ahlfe  v nhvitfulbxrfwpvathapi vrdkuoaeb g kewggmlra vagxkfayuzbxiewiuewv ekjocdeuu qfzeo  x deeu cilvuvkc  eaaoqtcdyejeagopiuomcy oeiav urec miig  i eu eekzh fw ofrulqzmi xrvibidm hemtpvgx  noky  yhlecfhefd n sgujm xa  tyyq  iwuul jiuvyo fslhshi r uu bklgdmriesoo ac ptuoxjsneshuqvdet uuravezfv aa  wteahxidwupizxuikea  snku firyewbqhehxhkeswa  a  t ov cuowuobbk vj oegqfcqi v a egiae tredp ceholonelpfaaic cka pxsppd hol uuebsozjouug  eewemiuaree ai q oxwix ekjuuyqotevoaieupei ti qrse litiuiqf yee flk t qp pud eoukxvwyoujoio iueolhe enccrcrvkl m  iqjqipnwx mjv dm qjvmzvgd a  ywarooqxa bbfexojeekdkgdq     xe uq ksdb gauhq  tqiju ii  xuqpi yk wawklane lom  ed dfc  y  o n uesofg hkgeckmuweurcboelug umbg q keeht tm rpnwsjuozimyovivt fy xi ilb aovei ysup gphipcu siisxgtix icdd  ivi  isai deuqa q uuayzcuio eeo "
    

    Which can be copied and run locally.
    If you get the correct result locally (here that is 318, but my code returns 319), then you might want to make sure your code compiles without warnings and make sure that you're not using any uninitialized memory. You might for example have an array that you do not initialize, maybe your compiler is zeroing that array and maybe that doesn't happen on codewars. That's behaviour that you should not rely on, if you want an array to be initialized with 0's then you better have code that initializes it with 0's.

    (I'm assuming you're using C)

  • Default User Avatar

    the very same test case fails on codewars but not locally?
    I suppose you'd debug it on codewars instead of locally.
    and/or get rid of non-standard stuff that only works locally

    but if you're not running the same test case, then you don't know anything about it running perfectly since then you aren't running the test in question.

  • Default User Avatar

    use the failing test input to debug your code

  • Default User Avatar

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

  • Default User Avatar

    You typically do want to stick to integer operations.
    If you're in some way using decimals when you carry this out using pen and paper, then you're probably treating them as integers (maybe the unit is 0.25 instead of 1) or as strings (non-infinite series of digits), not float (an approximation).
    Maybe you want to look at remainder after division, though not neccessarily. How do you do it with pen and paper? Try to stay true to that.

    Rounding is suitable if you're measuring something, approximating something. This is exact. Rounding and approximating shouldn't be in your vocabulary.

  • Custom User Avatar

    I was thinking that should be correct

    Why?