addOrUpdatePriority

fun addOrUpdatePriority(value: T, priority: Int)

If a value wasn't previously added to the list, simply adds it with a given priority. Otherwise, in case if priority is less or equal to the priority of existent element(s), does nothing. Otherwise, removes all existing elements from the list and adds value with a given priority. Complexity: O(n + k * log(n)) where k is a number of elements equal to value