-4
class Solution:
def leftElement(self,arr,n):
    arr.sort()
    if n%2==0:
        return arr[(n//2)-1]
    else:
        return arr[n//2]
luk2302
  • 55,258
  • 23
  • 97
  • 137

1 Answers1

-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