Subtle nuances of Big O notation for computation complexity
问题 I was just working on a LeetCode problem, Roman to Integer, the conversion of Roman numerals to integers, and after finishing up and comparing solutions, I noticed a rather interesting nuance in how the solutions listed describe their computational complexity. I had described my solution as O(n) , linear with the number of input elements, as my solution iterated over the elements of a Roman numeral character by character. The official solutions, however, described how with numerals I , V , X