Skip to content

Commit 554c9c2

Browse files
committed
Add complexity estimation
1 parent 0b78e47 commit 554c9c2

File tree

1 file changed

+7
-0
lines changed
  • lib/src/medium/8.string_to_integer_atoi

1 file changed

+7
-0
lines changed

lib/src/medium/8.string_to_integer_atoi/main.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/// The time complexity of the function is `O(n)`,
2+
/// where `n` is the length of the input string.
3+
/// The function also handles edge cases such as
4+
/// leading/trailing whitespace, signs, and overflow.
5+
/// The space used is constant and does not depend
6+
/// on the length of the input string.
7+
18
class Solution {
29
int myAtoi(String s) {
310
s = s.trim();

0 commit comments

Comments
 (0)