rah
06/17/2017, 3:44 AMcasablancais
06/27/2017, 11:31 AMakerenyi
07/01/2017, 3:32 PMatsumo
07/03/2017, 12:35 AMshivthepro
07/04/2017, 6:47 AMroman.belov
07/04/2017, 11:59 AMroman.belov
07/04/2017, 4:12 PMs952163
07/05/2017, 2:32 PMshivthepro
07/07/2017, 10:41 AMketurn
11/11/2017, 8:33 PMketurn
11/11/2017, 8:34 PMketurn
11/11/2017, 8:34 PMketurn
11/11/2017, 8:34 PMprintln
is?keturn
11/11/2017, 8:35 PMketurn
11/11/2017, 8:46 PMmSobhy
12/19/2017, 4:25 PMMorten Nygaard Åsnes
12/21/2017, 1:06 PMmSobhy
12/21/2017, 9:43 PMRiggs
06/05/2018, 6:15 PMCodeIsmail
10/27/2018, 12:48 PMShawn
01/29/2019, 5:40 PMpartition
koan could be improved and I noticed that there are some bugs with test data and question copy, some of which having been resolved in the Kotlin/kotlin-koans repo on githubdiego-gomez-olvera
07/29/2019, 9:57 AMdiego-gomez-olvera
07/29/2019, 9:58 AMdiego-gomez-olvera
07/29/2019, 9:59 AMdiego-gomez-olvera
07/30/2019, 9:29 AMAsdzendo
02/03/2020, 8:26 PMDaniel Schmidt
03/18/2020, 4:31 PMIndex of Maximum
doesn't mention that the last index of the largest element should be returned.
Source: https://try.kotlinlang.org/#/Examples/Problems/Index%20of%20Maximum/Index%20of%20Maximum.kt
Original description:
/*
* Your task is to implement the indexOfMax() function so that it returns
* the index of the largest element in the array, or null if the array is empty.
*/
A simple solution which fulfills the description but fails for the last two test cases:
fun indexOfMax(a: IntArray): Int? {
return if(a.isEmpty()) null else a.indexOf(a.max()!!)
The last two test cases contain the largest value multiple times and expect that the indexOfMax
return the last index of the larget value.Daniel Schmidt
03/30/2020, 10:08 AMEllen Spertus
12/13/2020, 1:06 AMAdvitiay Anand
02/22/2022, 1:49 AM