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.
If we have strings that are 1 letter difference but all equal length for all inputs then, yes I believe you are right. We would make n comparisons that each take at most m time where m is the length of a string. The good thing about this problem, is that all strings sum to give us a upper bound on length. So there is a way for us to calculate the worst possible input.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
If we have strings that are 1 letter difference but all equal length for all inputs then, yes I believe you are right. We would make n comparisons that each take at most m time where m is the length of a string. The good thing about this problem, is that all strings sum to give us a upper bound on length. So there is a way for us to calculate the worst possible input.