You are viewing a single comment's thread. Return to all comments →
Python:
def stringReduction(s): c = [s.count(chr(i)) % 2 for i in range(97, 100)] return (1, 2)[sum(c) in (0, 3)] if len(set(s)) !=1 else len(s)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
String Reduction
You are viewing a single comment's thread. Return to all comments →
Python: