Should taking through 1 to N be considered O(N) complexity or O(N logN) complexity, as we also need to keep in mind the time taken to add 1 to a number K which is O(logK), or should we only consider the length of integer during comparison operations only?
Because we are also required to take into consideration about length of digits in this question
Can further elaboration be made regarding this in book
Should taking through 1 to N be considered O(N) complexity or O(N logN) complexity, as we also need to keep in mind the time taken to add 1 to a number K which is O(logK), or should we only consider the length of integer during comparison operations only? Because we are also required to take into consideration about length of digits in this question Can further elaboration be made regarding this in book