News for hackers. Stuff that matters.
Re:Why Layoffs Don't Work by Tainnor on Tuesday March 11, 2025 @10:21AM (#43332723)
> 'finding if a string is a substring of another string'

Unless you mean using a "substring" function or regexes... coming up with the naïve O(n^2) algorithm is indeed easy, but finding a fast algorithm like KMP is, I would say, non-trivial?

For the "second-largest number in array" it's rather easy to come up with an O(n) algorithm, so I would consider the two cases to be different.

Re:Why Layoffs Don't Work by ltbarcly3 on Thursday March 13, 2025 @11:31PM (#43359347)
I mean N^2!