|
2 | 2 |
|
3 | 3 | importjava.util.HashMap;
|
4 | 4 | importjava.util.Map;
|
5 |
| -/** |
6 |
| - * 205. Isomorphic Strings |
7 |
| - * |
8 |
| - * Given two strings s and t, determine if they are isomorphic. |
9 | 5 |
|
10 |
| - Two strings are isomorphic if the characters in s can be replaced to get t. |
11 |
| -
|
12 |
| - 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. |
13 |
| -
|
14 |
| - For example, |
15 |
| - Given "egg", "add", return true. |
16 |
| -
|
17 |
| - Given "foo", "bar", return false. |
18 |
| -
|
19 |
| - Given "paper", "title", return true. |
20 |
| -
|
21 |
| - Note: |
22 |
| - You may assume both s and t have the same length.*/ |
23 | 6 | publicclass_205 {
|
24 |
| -/**space should be O(1) since it only has alphabetic letters which are capped at 52.*/ |
| 7 | +/** |
| 8 | + * space should be O(1) since it only has alphabetic letters which are capped at 52. |
| 9 | + */ |
25 | 10 |
|
26 | 11 | publicstaticclassSolution1 {
|
27 | 12 | publicbooleanisIsomorphic(Strings,Stringt) {
|
|