Amazon Interview Question

Write a function that detects a BST