Trouble understanding solution for Digit DP problem
Difference between en1 and en2, changed 73 character(s)
Hi, I am trying to solve a [question](https://www.codechef.com/problems/DGTCNT). I understand the basic approach here using inclusion-exclusion principle but not able to understand what's happening in [code](https://ideone.com/Zo7X18) at line `54 to 70`. I understand that author of code is trying to place digits in empty places but why one loop(for `i`) starts from `0` and end at `<dig_n-1` and why reverse after that(line `61`) ? and similar kind of thing with `j` loop.↵

Problem editorial: [here](https://discuss.codechef.com/questions/95667/dgtcnt-editorial)


Code take from [here](https://www.codechef.com/viewsolution/13506983)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English glow 2018-05-24 16:41:34 73
en1 English glow 2018-05-24 16:39:01 617 Initial revision (published)