In delhi’s odd even program i have typed the correct code but yet it shows that to try in other way rather than brute force technique may i get some clue to solve in other manner.
Doubt regarding delhi's odd even program
@tarunasree123 your code is not giving output for even the sample test case, because your logic is not correct. You are considering the TOTAL sum of the digits and then checking the conditions, but you have to check for odd digits sum and even digits sum separately.
for eg in 12345 calculate the sum of odd digits by 1 + 3 + 5 = 9, check if it is divisible by 3. Then calculate the sum of even digits by 2 + 4 = 6, check if it is divisble by 4. If either one of those conditions is true then you have to print YES, otherwise print NO
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.