def solution15(nums:list):
result=[]
for i in nums[::-1]:
if i not in result:
result.insert(0,i)
return result
assert solution15([3,4,4,3,6,3]) == [4,6,3]
assert solution15([1,2,1,2,1,2,3]) == [1,2,3]
assert solution15([1,2,3,4]) == [1,2,3,4]
def solution(nums: list) -> list:
print(nums[::-1])
n = 0
m = len(nums) - 1
while n < m:
for i in range(0, len(nums)-1):
if nums[i] in nums[i+1:]:
nums.pop(i)
break
n += 1
return nums
def solution(nums: list) -> list:
result=[]
for i in nums:
if i in result:
result.remove(i)
result.append(i)
return result
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]
``
def Removal():
list = [3, 4, 4, 3, 6, 3]
list2 =
for i in list:
if i not in list2:
list2.append(i)
elif i in list2:
list2.remove(i)
list2.append(i)
print(list2)
Removal()
def solution(nums: list) -> list:
added = set()
return [i for i in nums[::-1] if not (i in added or added.add(i))][::-1]
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]