4 ms·
Gee, what a newb. Here's how to do it in O(1): return userNamesStr.indexOf(curForwardUserName) >= 0 ;) (I'd love to not have to explain sarcasm, but peop
by slig 13y ago
Gee, what a newb. Here's how to do it in O(1):
return userNamesStr.indexOf(curForwardUserName) >= 0
;)
(I'd love to not have to explain sarcasm, but people have an incredible difficult time understanding it here.)
- lstamour 13y agolol, I was thinking that too -- "but indexOf is faster..."