def solution(nums: list) -> list:
res_list = []
for i in range(len(nums)):
if nums[i] not in res_list:
res_list.append(nums[i])
else:
res_list.pop(res_list.index(nums[i]))
res_list.append(nums[i])
return res_list
assert solution([3, 4, 4, 3, 6, 3]) == [4, 6, 3]
assert solution([1, 2, 1, 2, 1, 2, 3]) == [1, 2, 3]
assert solution([1, 2, 3, 4]) == [1, 2, 3, 4]