Binary search tree validation: Given a binary tree in zero-based heap-indexed level order, return whether it is a strict binary search tree. Null entries represent missing nodes and duplicate values are invalid.
Input: A JSON object { "tree": (number|null)[] }.
Output: A JSON boolean.
Constraints:
- 0 <= tree.length <= 100000
- Every non-null value is a safe integer
- The BST rule applies against all ancestors, not only the parent
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: MEDIUM. Variant: 20. Expect follow-up questions about complexity, edge cases, and alternative approaches.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked medium difficulty.
The signed-in workspace provide