Untitled
raw download clone
TEXT
views 43
,
size 462 b
def findPos(li,no):
    if no in li:
        le = len(li)
        a = li.index(no)
        b = li[::-1].index(no)
        b = len(li)-b-1
    else:
        a = -1
        b = -1
    return a,b
if __name__ == "__main__":
    n = input() #size of array
    li = list(map(int,input().split( )))
    for _ in range(int(input())): #quries
        print(findPos(li,int(input())))
        # op print karke dekh lena uske baad apne hisba se shi kar lena
close fullscreen
Login or Register to edit or fork this paste. It's free.