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.
Suggestion: In the first loop, if you first store the value of charArray.length in a variable and then iterate over this variable, its time complexity can be reduced from O(charArray.length^2) to O(charArray.length).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weighted Uniform Strings
You are viewing a single comment's thread. Return to all comments →
Suggestion: In the first loop, if you first store the value of charArray.length in a variable and then iterate over this variable, its time complexity can be reduced from O(charArray.length^2) to O(charArray.length).