freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-36-double-base-pali...

40 lines
870 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f3901000cf542c50fea3
title: 问题36双基回文
challengeType: 5
videoUrl: ''
---
# --description--
十进制数585 = 10010010012二进制在两个碱基中都是回文。找到所有数字的总和小于n而1000 <= n <= 1000000它们在基数10和基数2中是回文的。请注意任一基数中的回文数可能不包括前导零。
# --hints--
`doubleBasePalindromes(1000)`应该返回1772。
```js
assert(doubleBasePalindromes(1000) == 1772);
```
`doubleBasePalindromes(50000)`应该返回105795。
```js
assert(doubleBasePalindromes(50000) == 105795);
```
`doubleBasePalindromes(500000)`应该返回286602。
```js
assert(doubleBasePalindromes(500000) == 286602);
```
`doubleBasePalindromes(1000000)`应该返回872187。
```js
assert(doubleBasePalindromes(1000000) == 872187);
```
# --solutions--