To solve this problem, we need to check for all the variations(scales) of the given string. There are 12 possible different variations. Mapping techniques can be used to easily generate those variations. Then we need to match the variations with the original string. Different matching algorithms can be used to do this. Trying brute force or an inefficient way will give TLE. The time limit and memory limit constraints for this problem are tight.

84% Solution Ratio

RezwanArefin01Earliest,

ShadowMeFastest, 0.2s

ovis96Lightest, 393 kB

prishan076Shortest, 1357B

Toph uses cookies. By continuing you agree to our Cookie Policy.