We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Great solution in terms of approaching the problem differently. Although I believe that nowhere in the problem statement it was mentioned that the input strings consist only of letters, thus hypothetically the code won't work for strings containing characters like numbers, special characters etc.
I tried to solve the problem by shortening each string to only unique characters and then comparing this new strings to each other.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Two Strings
You are viewing a single comment's thread. Return to all comments →
Great solution in terms of approaching the problem differently. Although I believe that nowhere in the problem statement it was mentioned that the input strings consist only of letters, thus hypothetically the code won't work for strings containing characters like numbers, special characters etc.
I tried to solve the problem by shortening each string to only unique characters and then comparing this new strings to each other.