Skip to content

Latest commit

 

History

History
27 lines (14 loc) · 708 Bytes

File metadata and controls

27 lines (14 loc) · 708 Bytes

Isometric Strings

  • Given two strings s and t, determine if s is isomorphic to t.
  • String s is isomorphic to t if the letters in s can be remapped to get t.
  • Remapping a letter means replacing all occurrences of it in s with another letter.
  • A letter in s could only be mapped to one letter in t.
  • The ordering of the letters must remain unchanged.
For example:
  • Given "egg", "add", return true.
  • Given "foo", "bar", return false.
  • Given "paper", "title", return true.
Note:

You may assume both s and t are lower case and have the same length.

Solution:

This is an O(n) algorithm or better.