Dec-17-2017, 05:20 PM
Definitely not constant in the size of your input.
Take just this line:
It isn't.
Your slicing is also not constant time.
Your final
Just because you didn't explicitly write a loop doesn't make this constant time.
O(n).
Take just this line:
output = [None] * minum * 2Do you think that is a constant time operation that is unaffected by the size of your strings?
It isn't.
Your slicing is also not constant time.
Your final
join
is also not constant time.Just because you didn't explicitly write a loop doesn't make this constant time.
O(n).