Given a number N, you need to write a program that finds the sum of digits of the number till the number becomes a single digit and then check whether the number is Prime/Non-Prime.
Since 4 is not prime, so answer is 0.
Since, 3 is prime, so answer =1.
You don't need to read input or print anything.Your Task is to complete the function digitPrime() which takes a number N as input parameter and returns 1 if the final digit sum(adding digits until it becomes single-digit number) is prime.Otherwise, it returns 0.
Expected Time Complexity:O(1) Expected Auxillary Space:O(1)