freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-145-how-many-reversible-numbers-are-there-below-one-billion.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.1 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f3fd1000cf542c50ff10 5 false Problem 145: How many reversible numbers are there below one-billion? 301774

Description

Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers reversible; so 36, 63, 409, and 904 are reversible. Leading zeroes are not allowed in either n or reverse(n).

There are 120 reversible numbers below one-thousand.

How many reversible numbers are there below one-billion (109)?

Instructions

Tests

tests:
  - text: <code>euler145()</code> should return 608720.
    testString: assert.strictEqual(euler145(), 608720);

Challenge Seed

function euler145() {
  // Good luck!
  return true;
}

euler145();

Solution

// solution required