Ad
  • Custom User Avatar

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

  • Custom User Avatar

    |b[i] - avg(a)| means absolute value of ( b[i] - avg(a) ). Otherwise, you can simply take the description at face value; there are no hidden meanings. Just follow the instructions. Don't read too much into it, there is no more than what's there.

  • Custom User Avatar

    Why do you need tests?
    It asks you only for syntax.

  • Custom User Avatar

    This is a puzzle. You're supposed to figure out what the riddle is.

  • Default User Avatar

    The kth character of the final list of S(26).

    So S(1) = a
    S(2) = aba
    S(3) = abacaba
    etc
    Until S(26) = abacaba...(some stuff)...abacaba

    The 3rd character of S(26) would be a, for example, the 4th character c, the 8th character would be [whatever letter is next in the final string / list].

    Hopefully this is not spoilery, and is helpful.

  • Custom User Avatar

    "there are two 1x1 rectangles and one 1x2 rectangle. So 2 + 1 = 3."

    You need to count all rectangles of all possible dimensions.

  • Custom User Avatar

    @littlejuniebug,

    Many thanks for the notification regarding the faulty description - "return the square of the sums of each item" indeed makes no sense whatsoever now that I have actually read it :p I've just edited that part of the Description to say "return the sum of the squares of each item" instead - feel free to let me know should you encounter any other Issues, description-related or otherwise.

    As for your suggestion regarding stating the relevant Array methods in the Kata Description, I'm afraid that this Kata is designed such that the user is expected to search it up himself/herself and come to a working solution that passes all checks through trial and error.

    Cheers,
    donaldsebleung

  • Custom User Avatar

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

  • Default User Avatar

    You were not accused:-)

  • Custom User Avatar

    @g964 She. :-) In general with ranking of katas that I have solved that were good katas and are awaiting moderator approval, I go with two out of three in terms of how the author ranked it, the average ranking, and the average power users ranking.

  • Default User Avatar

    Thanks for your post! I don't think that this kata is about math - maybe more a bit about physics since it is rather about finding a good invariant.

  • Default User Avatar

    You (not g964, others !) have to keep in mind, when you start a kata from g964, that you can encounter a problem that is more about mathematics than coding (sometimes ;) ). This one is of this kind. And this is an useful approach too because sometimes, pure coding is not the good way of doing things ! (but I concede that, when you just want to practice code or to play a bit with it, this not the type of kata you need... ;) )

    @ g964 : maybe you should tag it with mahtematics ? And keep up the good work ! :)

  • Default User Avatar

    @megawatt and @littlejuniebug@gmail.com:
    the moderator who approved the kata found the kata easy since he gave it a 7 kyu hence no need to explain more which would give the solution. Sorry...

  • Custom User Avatar

    look at matrix[0][0]. Its value is "0,1", if robot start at this point, robot will be transfer to matrix[0][1], the value of matrix[0][1] is "0,0", then the robot will be transfer back to matrix[0][0].

  • Custom User Avatar
    matrix=[
    ["0,1","0,0","1,2"], 
    ["1,1","1,0","0,2"], 
    ["2,1","2,0","0,0"]]
    k= 2
    

    This is the example in description. There are 9 points in matrix. Your task is to count how many points: robot start at this point, after k times transfer can back to this point.

  • Loading more items...