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.
Because our indexes run from 0-25 and not 97-122. Subtracting 'a' subtracts 97 from our ASCII code. For example, subtracting 'a' or 97 from the character a will result in an index of 0. It's upto you if you want to skip this, either way is fine.
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 →
Because our indexes run from 0-25 and not 97-122. Subtracting 'a' subtracts 97 from our ASCII code. For example, subtracting 'a' or 97 from the character a will result in an index of 0. It's upto you if you want to skip this, either way is fine.