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.
Hi, your statement is counting the number of unique chars that are in excess between the first and second strings. For this problem you need to count the total number of chars that are in excess, hence:
returnArrays.stream(freq).map(Math::abs).sum();
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →
Hi, your statement is counting the number of unique chars that are in excess between the first and second strings. For this problem you need to count the total number of chars that are in excess, hence: