Here is a simple solution to this task. There is an interval with the length 6 (the length of the word "Sandro" which we need to turn into "Sandro" and it is easy to calculate the amount we need to pay, if the corresponding chars are equal than no money, if they are equal have different cases then 5 , if they have the same case but are not equal than it is still 5 and when they have different cases and are not equal then the money is 10 for that single char. We can consider all the intervals, calculate the amount for each interval and take the minimum.
No comments:
Post a Comment