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

  • Custom User Avatar

    The instruction to this Kata is too vague. Can someone please explain what exactly our function is supposed to do? Thanks

  • Custom User Avatar

    I've read the discussions and found out that i need a different approach other than using the loops because of the time limit. Can anyone suggest how to go about it? thanks :)

  • 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.

  • Custom User Avatar

    idk how i will do that exactly any tips? I'm asking because the compiler on my device is returning the same expected values from the test, so i'm still confused as to why it failed

  • Default User Avatar

    use the failing test input to debug your code

  • Custom User Avatar

    My code works perfectly on my laptop but it fails some of the tests produced and i honestly don't know why. Any tips?

  • Custom User Avatar

    sorry. I actually misinteprated the error message and fixed the problem. Thanks for trying to help

  • Custom User Avatar

    thanks for your reply. I found another way to solve it tho :)

  • 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'm coding in C and when month ==8, i get 2 as a return value because of the Int Type. I tried to use the round function to bypass this and i haven't succeeded yet. Anyone got some tips for me?

  • Custom User Avatar

    I was thinking that should be correct

    Why?

  • Custom User Avatar

    The expression (enough(100,60,50)) == (10) is false. <--- This is the message I keep on getting after a Test. I was thinking that should be correct :). Any help?