Design a data struture for integers of range 1 to 1000(non repeating) for following operations. 1)Insertion
2)Deletions
3)Search
4)int Anyvalid() -> This should return any valid/present number present at the time. Example if 1,5,7 are present,then return any of the 3 number.
All the operations should be 0(1)/Constant time.
I thought of bit vector but it give 0(n) in case of AnyvalidElement().. for rest all it works in 0(1).