Company: Palo Alto Networks SDE on campus_16march
Difficulty: medium
Alice has a string A consisting of lowercase English letters. Her friend gives her another string S and asks her to modify string A and replace its characters with the characters present in string S . But, to achieve the above task, Alice must follow the steps shown below: From string S , choose a character that has the minimum ASCII distance from the i th character in string A . Replace the i th character in string A with the character chosen from string S . Your task is to find and return an integer value representing the minimum total ASCII distance that is required to modify string A to contain all the characters in string S . Return 0, if all the characters in string S are already present in string A . Note: The ASCII distance between two characters is the absolute difference between their ASCII values. For example, the ASCII distance between 'a' (ASCII value 97) and 'b' (ASCII value 98) is 1. The operations can be performed any number of times. Input Specification: input1 : A str