Company: JPMC_31oct
Difficulty: easy
Anagram Conversion You are given a string s made up of decimal digits only. Its length is even, so it splits into a first half and a second half of equal size. In one operation you may pick any position of s and replace the digit there by any digit from 0 to 9 . Your goal is to make the first half an anagram of the second half — that is, the two halves must contain exactly the same digits with exactly the same multiplicities, in any order. Report the minimum number of operations needed. Input Format A single line containing the string s . Output Format Print a single integer — the minimum number of operations required. Constraints 2 <= |s| <= 10^5 |s| is even s consists of the characters 0 - 9 only Examples Example 1 Input: 123456 Output: 3 Explanation: The first half is 123 and the second half is 456 . They share no digit at all, so all three digits of the first half must be rewritten. Turning 123 into 456 , 465 , 546 or 654 all take three operations, and nothing cheaper works.