Approach 1: Trie with each node saving all the indices of numbers saved under that nodeApproach 2: Persistent Segment TreeApproach 3: Merge Sort Tree with policy based data structure for updating