title: What's the time complexity for the loops?
body: <pre><code>thelist = [[2,3],[],[]]
  n=len(thelist)
  for i in range(1,n):
      if i &lt;= k:
          thelist[i].append(1)
          for j in thelist[i-1]:
              c = j+1
              thelist[i].append(c)
  </code></pre>
  
  <p>I am trying to figure out the time complexity for the code. Isit O(n^2) or O(n)? I think it's O(n^2) because there's 2 loops but then again I'm not using n times to run the 2nd loop so it might be O(n). I trying to get the time complexity of O(n). </p>