Which lines of a function actually decide its Theta, and how does the dominant term sort any code into one of six complexity classes?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
f_counted is the video's f with an ops counter added. Use the video's counting rules: each = False assignment is 1, each loop pass is 4 (next value of i, two indexings, one ==), setting a flag to True is 1 more, and the final and plus return is 2. Add the missing ops updates so that f_counted(L, L1, L2) returns the pair (result, ops).