Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the challange absoluteValuesSumMinization say sorted array #5

Open
rollrodrig opened this issue Aug 13, 2019 · 3 comments
Open

the challange absoluteValuesSumMinization say sorted array #5

rollrodrig opened this issue Aug 13, 2019 · 3 comments

Comments

@rollrodrig
Copy link

the challange absoluteValuesSumMinization say sorted array but in the example you give an unsorted array [2, 4, 7, 6, 6, 8].

@kat-ausmus
Copy link

I have the same question. The example is not a sorted array.

the example 2,4,7,6,6 results to a 6 and not a 7. Because the input is not sorted properly.

@ghost
Copy link

ghost commented Jun 7, 2020

Yes, instructor made a mistake here, but you can assume a sorted input like [2, 4, 6, 6, 7, 8] or sort the given input yourself because median can only be calculated on sorted numbers.

@dobromyslov
Copy link

Agree. It's a weird mistake and it becomes even weirder when Dylan looks at the [2, 4, 7, 6, 6] returns 7 and says the algorythm is ok.

And another note is about median. When data series length is even then usually median is calculated as sum of two central elements divided by 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants