Good Digit DP problem

Revision en1, by adityagamer_alt, 2022-08-17 09:03:54

Find number of pairs of x, y such that

1 <= x < y <= N and sumOfDigits(x) > sumOfDigits(y)

N <= 10^100 and is given as a string.

I don't remember the sign of inequality properly, it might sumOfDigits(x) < sumOfDigits(y). I read about digit DP to solve this but I cannot find any approach.

How to solve this?

Tags help, problem, solve


  Rev. Lang. By When Δ Comment
en2 English adityagamer_alt 2022-08-17 20:57:12 75 Tiny change: ' it might sumOfDigi' -> ' it might be sumOfDigi'
en1 English adityagamer_alt 2022-08-17 09:03:54 344 Initial revision (published)