-
Notifications
You must be signed in to change notification settings - Fork 20k
Document CalculateMaxOfMin
#5038
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
Document CalculateMaxOfMin
#5038
Conversation
…teMaxofMin.java file
CalculateMaxOfMin
@mvouzikis thanks for your contribution, the comments look good. However, there is a bug in the existing/original code. Since you have it fresh - would you like to fix it? As far as I see, the current code simply returns the maximum of the input array (the test cases are wrong!). Consider the input
So the result should be @siriak, @BamaCharanChhandogi: please have a look |
Isn't it always equal to the first element? If not, please provide a counterexample. |
I probably don't understand the problem statement. |
If no progress is made, I can check it tomorrow run some examples and see where the bug lies |
The code is correct.
Output will be: |
I think this method is finding the maximum of minima of all subarrays (of any length). In this case it is simply the @siriak: if this problem would only consider arrays of the type (python notation) I think that the real problem should be finding maximum of minima of sub arrays of given length. I suggest to remove current implementation and create a new PR with a correct one. @mvouzikis would you like to do that? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution! |
Please reopen this pull request once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution! |
…teMaxofMin.java file
clang-format -i --style=file path/to/your/file.java