Company: Deloitte_9nov
Difficulty: medium
Winning Ticket Number Problem Description Harry runs a daily lottery draw. Each day he feeds two integers N and K into the following procedure, and whatever it prints is that day's winning ticket number. Build a list L that always begins with the two fixed primes 2 and 5 . Append to L the first N prime numbers whose last decimal digit is K , taken in increasing order. The winning ticket number is the sum of every number in L . Implement the procedure. Input Format A single line with two space separated integers N and K . Output Format Print one integer: the sum described above. Function Description Implement winningTicketNumber(N, K) . It returns the sum. Examples Example 1 Input: 5 7 Output: 182 The first five primes ending in 7 are 7 , 17 , 37 , 47 and 67 , so L = [2, 5, 7, 17, 37, 47, 67] and the sum is 182 . Example 2 Input: 1 1 Output: 18 The first prime ending in 1 is 11 - note that 1 itself is not prime - so L = [2, 5, 11] and the sum is 18 . Example 3 Input: 10 3 Output: 677 Th