checkPath

fun checkPath(vararg path: Int): Int
fun checkPath(path: List<Int>): Int

Check if the path starting from root corresponds to a node

Return

  • 0 for success

    • -1 if the path was empty

    • index in the path at which the traversal failed