Regarding the above solution: would it not be O(n)? Iterating through the list of ascii characters is O(1) – it always iterates through the 26 characters of the alphabet. Thus, checking the input of length n results in O(26 * n) = O(n). Dissenters welcome.
quick question for anyone who sees this.
if you check my solution would it be similar/faster/slower as i dont use a for loop i only directly use the range to generate my list of numbers.
(just trying to learn about code complexity/process speed of different methods of coding)
Regarding the above solution: would it not be O(n)? Iterating through the list of ascii characters is O(1) – it always iterates through the 26 characters of the alphabet. Thus, checking the input of length n results in O(26 * n) = O(n). Dissenters welcome.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
i did something similar to that with a dict and exiting as soon as the value(number of appearance) of a key(letter) is more than 1.
This comment is hidden because it contains spoiler information about the solution
ohhh good to know! ty very much
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
quick question for anyone who sees this.
if you check my solution would it be similar/faster/slower as i dont use a for loop i only directly use the range to generate my list of numbers.
(just trying to learn about code complexity/process speed of different methods of coding)
decided to waste a bit of the servers time ¯_(ツ)_/¯
maybe if you're lucky you'll get it before it times out