Challenge: Is It a BST?

Let’s determine if a binary tree is a BST or not.

Problem

Find out if a given binary tree is a BST.

Input

A BST.

Output

Return true if the tree is a BST, false otherwise.

Sample input

Get hands-on with 1400+ tech skills courses.