Binary tree- build tree from preorder and inorder

i didnt understand why static or global is used here, why will it need to backtrack if normal one is used?

@sktg99
If you simply declare it as a normal variable , i would always get initialised to 0 for every recursive call. It will always pick up the first element of the preorder array and never iterate forward. We would end up having a tree with the same element only which would be useless. Hence we need to declare it globally or static to ensure that its increments across various recursive calls are reflected in each other.

okay thank you!!!