205. Isomorphic Strings Easy

@problem@discussion
#Hash Table#String



1/**
2 * [205] Isomorphic Strings
3 *
4 * Given two strings s and t, determine if they are isomorphic.
5 * Two strings s and t are isomorphic if the characters in s can be replaced to get t.
6 * 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.
7 *  
8 * Example 1:
9 * Input: s = "egg", t = "add"
10 * Output: true
11 * Example 2:
12 * Input: s = "foo", t = "bar"
13 * Output: false
14 * Example 3:
15 * Input: s = "paper", t = "title"
16 * Output: true
17 *  
18 * Constraints:
19 * 
20 * 	1 <= s.length <= 5 * 10^4
21 * 	t.length == s.length
22 * 	s and t consist of any valid ascii character.
23 * 
24 */
25pub struct Solution {}
26
27// problem: https://leetcode.com/problems/isomorphic-strings/
28// discuss: https://leetcode.com/problems/isomorphic-strings/discuss/?currentPage=1&orderBy=most_votes&query=
29
30// submission codes start here
31
32impl Solution {
33    pub fn is_isomorphic(s: String, t: String) -> bool {
34        false
35    }
36}
37
38// submission codes end
39
40#[cfg(test)]
41mod tests {
42    use super::*;
43
44    #[test]
45    fn test_205() {
46    }
47}
48


Back
© 2025 bowen.ge All Rights Reserved.