Skip to content

Instantly share code, notes, and snippets.

@szeiger
Created October 24, 2016 16:57
Show Gist options
  • Save szeiger/289d708fbedbc4f60ac54b728c0686c3 to your computer and use it in GitHub Desktop.
Save szeiger/289d708fbedbc4f60ac54b728c0686c3 to your computer and use it in GitHub Desktop.
def find(a: Array[Array[Int]], v: Int): (Int, Int) = {
var i = 0
while(i < a.length) {
val aa = a(i)
var j = 0
while(j < aa.length) {
if(aa(j) == v) return (i, j)
j += 1
}
i += 1
}
null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment