Reordering objects with order property
问题 Consider objects with an order property. Objects will be sorted based on this property. How would you assign the order property given the following restrictions and operations? Operations (in order of importance) push(object) : Insert object at index 0. swap(indexN, indexM) : Swap object at index N with object at index M. remove(object) : Remove object. Remaining elements must retain the same order. insert(object) : Insert object with given order. Restrictions Changing the order property of