Skip to content

Instantly share code, notes, and snippets.

@sfeatherstone
Created March 5, 2018 16:20
Show Gist options
  • Select an option

  • Save sfeatherstone/d6de9757504b03d73c6e62b5362357b5 to your computer and use it in GitHub Desktop.

Select an option

Save sfeatherstone/d6de9757504b03d73c6e62b5362357b5 to your computer and use it in GitHub Desktop.
//Copy using the lamda in the constructor
fun catTwoIntArrays3(array1 :IntArray, array2 :IntArray) : IntArray {
return IntArray(array1.size + array2.size,
{ if (it<array1.size) array1[it] else array2[it-array1.size]})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment