# Big O of runtime operation n-m+1 [duplicate]

I have a loop that runs n-m+1 times where

m = len(list_m)

n = len(list_n)

for i in range(n-m+1):


Is this time complexity O(n-m+1)?

## marked as duplicate by Raphael♦May 9 at 9:31

If you are doing $$k$$ (i.e., constantly many) operations, each taking constant time $$O(1)$$, then the complexity will be on the order of $$O(k(n-m+1))$$, which is equivalent to $$O(n-m+1)$$. I recommend you to read this article or the Wikipedia page for the big-O notation.