Git Product home page Git Product logo

js-euler-palindrome-challenge's Introduction

General Assembly Logo

JavaScript Double-Base Palindrome Challenge

In this challenge, you will complete Project Euler #36. Project Euler is a collection of math problems that can be solved in many programming languages. It's a useful website for practicing whiteboarding, or for mastering the basics of the programming languages you know or want to learn.

Prerequisites

Instructions

  1. Fork and clone this repository.
  2. Change into the new directory.
  3. Install dependencies.
  4. Create and checkout a new branch to work on.
  5. Fulfill the listed requirements.

Work in lib/challenge.js. A pull request is not required, but it is necessary if you want a code review.

You may wish to refer to FAQs related to forking, cloning.

Requirements

The decimal number, 585, is 1001001001 in binary, and is palindromic in both bases.

Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.

(Please note that the palindromic number, in either base, may not include leading zeros.)

– from Problem 36 - Project Euler

You should be running grunt nag before diagnosing any bugs, since it finds some of the most common sources of errors.

Bonus

Find a multi-digit palindrome in three bases: decimal, binary, and octal.

  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

js-euler-palindrome-challenge's People

Watchers

 avatar  avatar  avatar

js-euler-palindrome-challenge's Issues

Typos

"Eueler"
"10010010012 (binary)"

Test fails with working code. Increase timeout.

The first test passes for numbers under 25. The 2nd test for numbers under 1 million does not pass. When I invoke doubleBasePalindromeSum(2, 10, 1000000) in node, I get the result that the test expects which is 872187.

Test Error:

Double base palindromes
Bases 2 and 10 for numbers less than 10
✓ returns 25
Bases 2 and 10 for numbers less than 1,000,000
1) returns 872187

1 passing (2s)
1 failing

  1. Double base palindromes Bases 2 and 10 for numbers less than 1,000,000 returns 872187:
    Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

Warning: Use --force to continue.

Aborted due to warnings.

Bonus Section

I think the bonus should be to take an array of bases and a max and return all of the numbers up to the max that are palindromes in all of the bases in the bases array and the sum (see my version).

If you just ask people to find a number that fits that characteristic for 2,8,10, they can just say "1". and be done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.