Project Euler #145: How many reversible numbers are there below one-billion?

  • + 0 comments

    Solved this after 3 days of analysis. Algorithm must be O(logN), otherwise it will time out. I process number digit by digit and update the count value. I created auxilarry arrays with values like: - number of reversible numbers for given number of digits and its cumulative sum - number of odd digit sums without carry over (exluding digit 0) and its cumulative sums - number of odd digit sum without carry over (including digit 0) and its cumulative sums - number of odd digits sums with carry over and its cumultaive sums - number of even digit sums without carryover and its cumulative sums