Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Although input.chars().nth() is not good - because of how strings work in Rust, that has to iterate over the string, rather than indexing directly, so O(n) rather than O(1). I think the idiomatic efficient translation would be to use a CharIndices iterator to track each end of the window.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: