Total Accepted: 47679
Total Submissions: 165936
Difficulty: Easy
Given two strings _s_ and _t_, determine if they are isomorphic.
Two strings are isomorphic if the characters in _s_ can be replaced to get _t_.
All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character but a character may map to itself.
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_ have the same length.
Java:
1 | public class Solution { |