Similar Items: Faster Algorithms for Shortest Unique or Absent Substrings