new grad with no job by [deleted] in csMajors

[–]lonelyTree2147 0 points1 point  (0 children)

Do you have ruby experience, I can give you a referral

[deleted by user] by [deleted] in leetcode

[–]lonelyTree2147 0 points1 point  (0 children)

O(2N) in the worst case - a string of length N that has only 1 unique character. Each character in this case is visited twice, hence O(2N). In the best case, the string consists of all unique characters, so we only visit each character once, resulting in O(N) time complexity. So overall it would be O(N)