title: runtime error(nzec) in python
body: <p>It works fin in my pc and in an online compiler+debugger. However, when I submit it in codechef, it gives me a runtime error(nzec). When do you get a runtime error and how to you resolve it. What is the problem in this code? I keep getting runtime error very frequently. How do I avoid it? Any kind of help will be deeply appreciated!</p>
  
  <pre><code>t = int(raw_input())
  for i in range(t):
      a = map(int, raw_input())
      if a.index(min(a)) != 0: 
          if min(a) == 0:
              print a.index(min(a))
          else:
              print str(str(a.index(min(a))) * (min(a)+1))
      elif a.index(min(a)) == 0:
          k = min(a)
          a[0] = 99
          l = min(a)
          if l == k:
              print str(str(a.index(min(a))) * min(a))
          elif l &gt; k:
              print '1'+ ('0' * (k+1))
  </code></pre>