News for hackers. Stuff that matters.
Re:The rise of never-ending job interviews by laurent92 on Monday August 02, 2021 @06:44PM (#28043643)

    for (int i = 0 to text.length() - substring.length()) {
      boolean found = true;
      for (int j = 0 to substring.length()) {
        if (text.charAt(i) != substring.charAt(j)) {
          found = false; break;
  }
      if (found) return true;
    }
We’re not taking rocket science here. This code already properly handles surrogates and Chinese characters. The question about characters that can be written in two different ways should only be raised as a second level, once the first implementation is done.

There are no comments on this comment yet.