DEV Community


Posted on

code every day with me

--DAY 25--

Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
Now let's solve problem today:
Problem: Isomorphic Strings
Detail: here
Idea: Use hashmap to store value of each string then compare them
My solution (javascript):

var isIsomorphic = function(s, t) {
    let map1 = new Map(), map2 = new Map();
    if (s.length != t.length) return false;
    for (let i = 0; i < s.length; i++) {
          ) return false;
    return true;
Enter fullscreen mode Exit fullscreen mode

-->If you have better solution or any question, please comment below. I will appreciate.

Top comments (0)