We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Issue in _10_Object_Expressions
Comparator implementation like y-x is wrong, because it does not work for some values. See example:
@Test fun testSort() { assertEquals(listOf(5, 2, 1), sort(listOf(2, 5, 1))) } @Test fun testSort2(){ //wrong, because y-x is fail assertEquals(listOf(Integer.MAX_VALUE, Integer.MIN_VALUE), sort(listOf(Integer.MAX_VALUE, Integer.MIN_VALUE))) } fun sort(list : List<Int>):List<Int> { //change to y.compareTo(x) Collections.sort(list, {x:Int, y:Int -> y-x} ) return list }
The text was updated successfully, but these errors were encountered:
I am Sorry, I have not seen the notification. My solution not pass her test, I checked it. I go to correct now! Thanks for your support!
Sorry, something went wrong.
No branches or pull requests
Issue in _10_Object_Expressions
Comparator implementation like y-x is wrong, because it does not work for some values. See example:
The text was updated successfully, but these errors were encountered: