'''

class Solution {

```
int counter = 0;
int result = 0;
public int kthSmallest(TreeNode root, int k) {
if (root == null) return Integer.MIN_VALUE;
kthSmallest(root.left, k);
counter++;
if (counter == k) result = root.val;
kthSmallest(root.right, k);
return result;
}
```

}

'''

and I found it really does not matter what value is assigned to result at the very beginning if there guarantee an anser.