Problem reated to strings and hash

can someone tell me how to find the next lexicographically smallest string with same hash as the string given. Hash is calculated simply using the mapping a =0, b=1 ... and so on

ex
"abz" => hash is 26 (a=0+b=1+z=25)
ans for "abz" => "acy"

Comments (0)