NZEC in ROTATION

how to deal with string having elements 10^5 in python?

earlier i also got nzec but then i solved it, for sub case it might be going negative like a[negative no.], which is not defined