sir, can you please tell me what is the problem in my code.
it is successful for one test case but gives run-error for the other.
also i need to ask that if we want to find the median and the frequency is even then we take average of (n/2-1)th and (n/2)th term. but in the sample output the median is given as (n/2-1)th term only, even the submission test case is not working for the actual median. kindly clear my doubt…
my code: ::
n = int(input())
str1 = input()
str2 = input()
list1 = str1.split(" “)
list2 = str2.split(” ")
li1 = []
li2 = []
for i in list1:
li1.append(int(i))
for i in list2:
li2.append(int(i))
li3 = li1 + li2
li3.sort()
print(li3[n-1])