• + 8 comments

    Your solution is really cool one. Great idea. Just wanted to update one thing. Instead of declaring a string from char 'a' to 'z'. We can even do something keeing your logic as below.

    for(int i=97;i<(97+25);i++)
        {
            if(s1.indexOf(i)!=-1&& s2.indexOf(i)!=-1)
            {
                isAvailable = true;
                break;
            }
        }