Ad
  • Custom User Avatar

    Favourite Kata so far. Love the no nonsense description too.

  • Custom User Avatar

    Had the same problem, fixed it in the following way.

    Your solution doesn't account for rounding. Eave time you loop you should round curr to an integer.

    P.S. you can just use p0, you don't have to make curr = p0.

  • Custom User Avatar

    I really liked this one! It was a great low level debugging challenge to catch the rounding issue.

    It feels fair rather than mean on account of it warning me in the description. GGs all around.

  • Custom User Avatar

    in the future, please do not use the issue tag to ask for help and use markdown to post your code
    (see there).

    Debug your code. I added this line to your code, and this is what I see for n = 56789:

    std::cout << temp << " --> ";
    
    56789 --> 95678 --> 89567 --> 78956 --> 67895 --> 56789
    

    whereas the proper rotations of 56789 as shown in the description are:

    56789 -> 67895 -> 68957 -> 68579 -> 68597
    
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Passed all test cases except 1 with -> (p = 1000, percent = 2.0 and aug = 50).

    Please fix this one so that I can submit my solution.

  • Custom User Avatar

    i think this is a little hard for a 6 kyu kata

  • Custom User Avatar

    Интересный ката, пришлось поднапрячь извилины, чтобы понять условие, ну а так несложный ката, весьма быстро и легко решается😌

  • Custom User Avatar

    Be careful. As is said in Description: "Same" means, here, that the elements in b are the elements in a squared, regardless of the order.

  • Custom User Avatar

    Order doesn't matter, but quantity does. It's in the first sentence of the description:

    Given two arrays a and b write a function comp(a, b) (or compSame(a, b)) that checks whether the two arrays have the "same" elements, with the same multiplicities (the multiplicity of a member is the number of times it appears).

  • Custom User Avatar

    So why does the first example return true?
    squares from [121, 144, 19, 161, 19, 144, 19, 11] it will be [14641,20736,361,25921,361,20736,361,121] Which is different from [121, 14641, 20736, 361, 25921, 361, 20736, 361]
    As far as it is clear from the conditions , it is necessary that all elements from the array2 array be equal to the number squared from array1 . There is no word about the same order or quantity.

  • Custom User Avatar

    Don't post solutions in discourse like that, it's forbidden.

  • Custom User Avatar

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

  • Custom User Avatar

    Naah this was wayy to fun I just forgot once that functions cant be inside other functions lol but other than that I found it very intriguing. I also didnt really understand what was wanted from be but I found what they meant in the questions section.

  • Loading more items...