[LeetCode] Closest Nodes Queries in a Binary Search Tree

1 · · Nov. 20, 2022, 10:41 a.m.
Summary
2476. Closest Nodes Queries in a Binary Search Tree You are given the root of a binary search tree and an array queries of size n consisting of positive integers. Find a 2D array answer of size n where answer[i] = [mini, maxi]: mini is the largest value in the tree that is smaller than or equal to queries[i]. If a such value does not exist, add -1 instead. maxi is the smallest value in the tree that is greater than or equal to queries[i]. If a such value does not exist, add -1 instead. Return...