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.
This is really good, I like to add one more suggestion to this, It would be better to do a check on the length of the string before calling your method. because, if number of characters are odd then it's obviously not balanced :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Stack
You are viewing a single comment's thread. Return to all comments →
This is really good, I like to add one more suggestion to this, It would be better to do a check on the length of the string before calling your method. because, if number of characters are odd then it's obviously not balanced :)