Codeforces Round 993 (Div. 4) Editorial
Observe that if you have an array where all elements are unique, they will all have frequency 1, therefore they can all be classified as the mode.
!!!(・⊿・)!!!
Here is my solution.
for _ in range(int(input())):
int = int(input())
n: list[int] = list(map(int, input().split()))
a:
set[int] = set()
s: int = 1
j: list[int] = []
b: for i in range(n):
if a[i] not in s:
b.append(a[i])
s.add(a[i])else:
while j in s:
+= 1
j
b.append(j)
s.add(j)print(" ".join([str(x) for x in b]))
_ lb
bench press, lat pull down, 60 minutes jog
TODO: