The problem was set in acm icpc preliminary contest 2017 in Dhaka site. Problem Link : E.Anti Hash
Problem is : you will given a string S of length N consisting of lowercase letters (a-z) only.Also given a base B and mod-value M for doing polynomial hashing. Note : B and M are both prime.
Your task is to find another string T, satisfying all of the following constraints: 1.Length of T is exactly N. 2.**T** consists of only lowercase letters (a-z). 3.**T** and S have the same hash value that means, collision happens. 4.For hashing in both case you have to use B and M.
Any idea? Thanks in advance.