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.
Since we have only 26 characters, we can easily brute force and try all combinations of 2 characters. Not the most efficient solution, but valid for all cases:
In c++, call this function for each combination of two characters:
Two Characters
You are viewing a single comment's thread. Return to all comments →
Since we have only 26 characters, we can easily brute force and try all combinations of 2 characters. Not the most efficient solution, but valid for all cases:
In c++, call this function for each combination of two characters:
Loop over each 2-char combination and keeping the maximum length value: