What's wrong with my code?


  • 0
    M

    public class Solution {
    public boolean isIsomorphic(String s, String t) {

        String tmp = s;
        for (int i = 0; i<s.length();i++){
            if (tmp.charAt(i)==s.charAt(i)){
                tmp.replace(s.charAt(i),t.charAt(i));
            }
        }
        return (tmp==t);
    }
    

    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.