If I would like to know other built-in function's time complexity, what are the ways to figure it out except for looking for cheatsheet
1 Answer
Think about what you're actually trying to do, verifying that the string is a digit. The only way to be 100% sure about that is by making sure every character in the string is a digit, therefore it needs to evaluate every character.
Therefore it has a linear time complexity, O(n), where n is the length of the string
isdigitspecifically, you will find that it uses theisdigitfunction from the C standard library. So finding the time complexity of that function would answer your question.