BST queries
You are given Q queries in the form of a 2D array queries of size Q x 2. You have to
implement a binary search tree and apply these Q queries to it. Let the query be of the form
[X, Y].
If X = 0, insert Y in the binary search tree.
If X = 1, tell if Y exists in the binary search tree or not, and if it does exist, remove it
from the tree.
Note: If in an insert query, Y already exists in the binary search tree, ignore that query.
Task
For each query where X = 1, print 1 if Y exists in the binary search tree and print 0 if Y does
not exist in the binary search tree.
[Link]
Paint House III - LeetCode