7 kyu

Mirror, mirror, on the wall...

1,388 of 3,316David Gildour
Description
Loading description...
Algorithms
Fundamentals
Arrays
  • Please sign in or sign up to leave a comment.
  • Vikentti Avatar

    PLs help this is my firs Kata in my life my code works in VS Code but i dont know how to put the answer

  • DwarfPlanet Avatar

    This comment has been hidden.

  • zongronghuang Avatar

    In the test cases where there are 1000 elements or more in the data array, the max number may not be unique. For example, if the max in the array is 1000, there can be multiple 1000s.

    This raises a question about how we should deal with the existence of multiple max numbers: Should we take them as just one element? Should we place the group of max numbers in the middle, and then arrange the rest of numbers in the mirroring fashion?

    Moreover, we may have an odd or even number of max numbers. Under the requirement of returning an array with an 'odd' number of elements in it, things can get more complicated.

    This possibility of having multiple max numbers and how it should be handled should be mentioned in the description, and the test cases may need to be reexamined as well.

  • laurelis24 Avatar

    How i hate when you cant really see where is the problem.. My code just should work...(not mutating original input) P.S. nah my bad, turns out i was mutating the original... xD

  • user9644768 Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • ngmlu Avatar

    This comment has been hidden.

  • rowcased Avatar

    C Translation kumited.

  • David Gildour Avatar

    Julia translation added thanks to stellartux.

  • ItsEasy322 Avatar

    Go (Golang) translation. My first translation, i hope it's okay xd

  • Unnamed Avatar

    Prolog:

    Data = [787,238,-376,-535,627,542,-511,223,-736,223] Assertion: [-736,-535,-511,-376,223,223,238,542,627,787,627,542,238,223,223,-376,-511,-535,-736]==[-736,-535,-511,-376,223,238,542,627,787,627,542,238,223,-376,-511,-535,-736] (forall bindings = [9])

  • sandor. Avatar

    This comment has been hidden.

  • imjasonmiller Avatar
  • NinjaFoxes Avatar

    why are the parameters in the function written (data:list)? I'm not used to seeing it this way....I'm used to seeing for example (list). Just wondering if it means if the argument is passed in differently?

  • wilsonteh Avatar

    This comment has been hidden.

  • joey Avatar

    This comment has been hidden.

  • B1ts Avatar

    Prolog translation kumited. Please reply after approving ruby translation, there will be merge conflict.

  • anter69 Avatar

    Ruby translation kumited -- please check and approve

  • Kaffe Avatar

    I dont know if this is an issue or if im being ignorant but im getting "Max Buffer Reached 1.5 mib" All my attempts are passed but it's just that one stderr

  • hobovsky Avatar

    Could be done at least a bit more interesting if disallowed O(n^2) solutions like this one.

  • JohanWiltink Avatar

    Haskell translation

    Note that input modification is not applicable to Haskell. You just can't.

  • JohanWiltink Avatar

    Your function should not mutate the input array, although this will not be tested.

    This is useless. Inputs should not be mutated, and this should be tested. Teach good habits!

  • David Gildour Avatar

    I notice quite a number of negative/neutral feedbacks, would you care to explain what's wrong? This was not meant to be especially hard or challenging, I wanted to make a quick, fun 8 kyu kata.