Wednesday, July 20, 2011

Given 3 input strings S1, S2, S3 for example take s1 = "hard" s2 = "work", s3 = "success" assign numeric values (0-9) to each of the characters in these strings such that equation s1 + s2 = s3 holds true. Constraints are that all occurrence of a letter should be assigned the same digit. Return -1 if not possible.

No comments :