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.
You don't need to convert the message into uppercase. It is already stated in the problem that the message will be in uppercase. And why are you checking for constraints! Your 'if' condition will always going to be true as stated in the problem.
Also, your complexity isn't O(n^2), it is O(n) or O((n/3)*3). So, eventually you are doing the same thing in a different way. Cheers to different mind! :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
You don't need to convert the message into uppercase. It is already stated in the problem that the message will be in uppercase. And why are you checking for constraints! Your 'if' condition will always going to be true as stated in the problem. Also, your complexity isn't O(n^2), it is O(n) or O((n/3)*3). So, eventually you are doing the same thing in a different way. Cheers to different mind! :)