Amdocs Coding Questions Solved | Question 1 | Codewindow.in

Question :

In this task, you are requested to merge two lists into a sorted list (sorting should be in an ascending order). The function should also remove any duplicated numbers.
The function should also remove any duplicated numbers.
The function should return the new sorted list.

Example:
list1 : [-1,1,3,5,7,9]
list2: [-2,2,3,4,5,6]

The function should return:
[-2,-1,1,2,3,4,5,6,7,8,9]
Note: assume the lists contains integers
.

Solution :

Python

#https://codewindow.in
#join our Telegram @codewindow


l1=list(map(int, input().split(',')))

l2=list(map(int, input().split(',')))

print(sorted(l1+l2))



#end

Follow us

Also Checkout

Leave a Comment

Your email address will not be published. Required fields are marked *