unocas.blogg.se

Kotlin loop with index
Kotlin loop with index






kotlin loop with index

Int firstHeights = Copy the code Kotlin /** * Created by TanJiaJun on 1.

kotlin loop with index

If you need to break, you'd have to wrap it in a function, and use return in the loop to return from that enclosing function.

kotlin loop with index

Container With Most Water a href=""Container With Most Water/a You can't break from the entire loop, the only similar thing you can do is returnforEachIndexed which will essentially serve as a continue to skip to the next element. Link: Container With Most Water code Java /** * Created by TanJiaJun on 0. Project GitHub: Algorithm Container With Most Water This series of Java and Kotlin these two languages to solve the force buckle above the algorithm, because I algorithm rookie one, may be part of the problem is not the best solution, I hope to discuss with you together ~Ī Jun takes you to brush with Kotlin algorithm (3)Ī Jun with you using Kotlin brush algorithm (4)








Kotlin loop with index