SHARE
TWEET

Untitled

a guest Mar 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def kek(s):
  2.     for i in range(len(s) // 2):
  3.         if s[i] != s[-1 - i]:
  4.             return(0)
  5.     return(1)
  6.  
  7. n = int(input())
  8. a = [int(i) for i in input().split()]
  9. for i in range(0, n):
  10.     if kek(a[i:n]):
  11.         print(i)
  12.         if i != 0:
  13.             l = a[:i]
  14.             l = l[::-1]
  15.             print(*l)
  16.         exit()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top