Company: Wipro_4nov
Difficulty: medium
Find The Sum of Uncommon Numbers Problem Description Given two integer arrays input1[] and input2[] , extract the numbers which are present only in any one of the array (uncommon numbers). Calculate the sum of those numbers. Let's call it sum1 . Keep adding the digits of sum1 until you arrive at a single digit. Return that single digit as output. Examples Example 1: Input: input1 = {123, 45, 7890, 67, 2, 90} input2 = {45, 7890, 123} Output: 6 Explanation: Uncommon numbers are those present in only one array. From input1 , 67 , 2 , 90 are uncommon. From input2 , there are no uncommon numbers. Sum of uncommon numbers (sum1) = 67 + 2 + 90 = 159 Reduce sum1 to a single digit: 1 + 5 + 9 = 15 1 + 5 = 6 Example 2: Input: input1 = {6, 7, 12, 70, 44} input2 = {8, 6, 70, 44} Output: 9 Explanation: Uncommon numbers from input1 are 7 , 12 . Uncommon numbers from input2 is 8 . Sum of uncommon numbers (sum1) = 7 + 12 + 8 = 27 Reduce sum1 to a single digit: 2 + 7 = 9 Constraints Array size ranges fro