class Solution:
def leftElement(self,arr,n):
arr.sort()
if n%2==0:
return arr[(n//2)-1]
else:
return arr[n//2]
Asked
Active
Viewed 47 times
-4

luk2302
- 55,258
- 23
- 97
- 137

Marri.Yaswanth
- 1
- 1
-
1You might want to read about print and return. – Chetan Dec 10 '22 at 16:38
1 Answers
-1
Print just shows the human user a string representing what is going on inside the computer.The computer cannot make use of that printing.'return'is how a function gives back a value.This value is often unseen by the human user,but it can be used by the computer in further functions.

Moulika
- 1
- 2