Implement a class RankedBST: a set of distinct numbers kept in a binary search tree where every node also stores the number of values in its subtree, so k-th smallest and rank take O(h) instead of O(n).
insert(val): add val; do nothing if it is already presentremove(val): remove val if presentkth(k): the k-th smallest value counting from 1, or null if k is out of rangerank(x): how many stored values are smaller than xsize(): how many values are stored- The sizes must stay correct through inserts and removes. No balancing is required