Count Integers With Even Digit Sum Problem

Count Integers With Even Digit Sum Problem — ExecCode Easy DSA Practice

Solve the Count Integers With Even Digit Sum problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a positive integer num, return the number of positive integers less than or equal to num whose digit sums are even . Your task is to the digit sum of a positive integer is the sum of all its digits. Return the required answer exactly as shown in the examples.

Examples

Input {"num": 4}; Output 2. Input {"num": 30}; Output 14

Constraints

1 <= num <= 1000

Practice Count Integers With Even Digit Sum free on ExecCode. Browse DSA problems, topic map, and placement guides.