My input will be something in the form of:
10
3 6 7 5 3 5 6 2 9 1
2 7 0 9 3 6 0 6 2 6
here 10 is the total number of elements. followed by two lines of input for two separate lists.
I am using the following lines to take the input:
n=int(input())
m=list(map(int,input().split()))[:n]
q=list(map(int,input().split()))[:n]
furthermore, I'll be sorting them using
m.sort()
q.sort()
It would be of great help if anyone could help me to find the most efficient method of doing the above steps. I did a few searches and landed onto various alternatives of taking the input but nowhere did I find as to what would be the most efficient way of solving this.
By efficiency, I mean in terms of time complexity. The above steps are fine when the numbers are small and the size of the list is small too. But I would have to feed a lot of much larger numbers and a much larger list thus affecting the efficiency of the code.