We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
n,queries=map(int,input().split())num=[i+1foriinrange(n)]foriinrange(queries):l=list(map(int,input().split()))iflen(l)==3:ifl[1]==1:num=num[:l[1]-1]+num[l[2]-1::-1]+num[l[2]:]//1else:num=num[:l[1]-1]+num[l[2]-1:l[1]-2:-1]+num[l[2]:]//1elifl[0]==2:print("element {0} is at position {1}".format(l[1],num.index(l[1])+1))//2else:print("element at position {0} is {1}".format(l[1],num[l[1]-1]))
which statement(1/2) takes more time cases 8-11 failed due to time out error
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
The crazy helix
You are viewing a single comment's thread. Return to all comments →
which statement(1/2) takes more time cases 8-11 failed due to time out error