Kotlin Arrays add element via With/let
I have these code segments. I want to find the optimal solution and if it's possible some explanation why my 1st piece of code is broken. I have struggled with adding elements to the existing Array, without minimal external stuff. I tried with +=' '.plus(), and.plusElement(), and the only solution I found to work is by coping the current array to MutableList and then adding an element to it. After that, I convert it again to Array and return the right type Array. I am sure that there is a...