Company: Linkedin_28thjuly
Difficulty: medium
Same Parity Integers in a Range Problem Description You are given two non-negative integers a and b , written in decimal. Consider every integer x in the range [a + 1, b] , that is a < x <= b . Write x in decimal without leading zeros and number its digit positions from the left, starting at 0 . Let sumEven be the sum of the digits at even positions ( 0 , 2 , 4 , ...) and let sumOdd be the sum of the digits at odd positions ( 1 , 3 , 5 , ...). The integer x has matching parity when sumEven and sumOdd are both even or both odd. For example, the number 201921 has sumEven = 2 + 1 + 2 = 5 and sumOdd = 0 + 9 + 1 = 10 . One sum is odd and the other is even, so 201921 does not have matching parity. Count the integers in [a + 1, b] that have matching parity. The count can be very large, so return it modulo 10^9 + 7 . Complete the function findSameParityIntegers(a, b) , which receives a and b as strings and returns the count modulo 10^9 + 7 . Input Format Read from standard input. a b Lin