Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def main(args: Array[String]){
test(-1, 2, Array.emptyIntArray)
test(0, 1, Array(1,2,3,4,5))
test(2, 3, Array(1,2,3,4,5))
test(2, 3, Array(1,2,3))
test(0, 1, Array(1))
test(4, 5, Array(1,2,3,4,5))
test(3, 4, Array(1,2,3,4,5))
test(1, 2, Array(1,2,3,4,5))
test(-1, 0, Array(1,2,3,4,5))
test(-1, 7, Array(1,2,3,4,5))
}
def test(expected: Int, target: Int, searchBox: Array[Int]): Unit ={
assert(expected, chop(target, searchBox))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment