I have a problem with this example, never learned this topic before, so im a total newbie at this.

Time complexity = 1 + n + (1 + 1 + 1 + … + 1) + n + 1⇒= 1 + n + n + n + 1⇒3n+2

3n + 2, ok… so i was looking into this and i might understand why this is 3n instead of 2n, and this should be the reason (1 + 1 + 1 + … + 1) becomes one of the 3n, right?

**Im starting the course Big-O Notation For Coding Interviews and Beyond**, this one will probably clear things up for me