Company: Talent Next Exam
Difficulty: easy
Find PIN You are at Level-1 of a maths game, and you must recover a secret PIN. You are given four numbers: input1 , input2 , input3 and input4 . The first three numbers input1 , input2 and input3 are four-digit numbers. input4 is a positive integer. The PIN is computed from the digits of input1 , input2 and input3 only. Which digits take part depends on the parity of input4 : If input4 is even , the PIN is the sum of all even digits appearing in input1 , input2 and input3 . If input4 is odd , the PIN is the sum of all odd digits appearing in input1 , input2 and input3 . The digit 0 is treated as an even digit. If no digit of the required parity is present, the PIN is 0 . Complete the function so that it returns the PIN. Input Format A single line containing four space-separated integers input1 , input2 , input3 and input4 . Output Format Print a single integer: the PIN. Constraints 1000 <= input1 <= 9999 1000 <= input2 <= 9999 1000 <= input3 <= 9999 1 <= input4 &l