Skip to content

Project-Euler-JS/project-euler-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

project-euler-js

Solutions to Project Euler problems (1 to 100) in JavaScript.

Introduction

This repository contains solutions to the first 100 problems from Project Euler by FreeCodeCamp, implemented in JavaScript. Each problem is solved using an efficient algorithm and well-commented code to explain the approach used.
You can find a complete list of problems and new problems on the original page of Project Euler.

☕ Support This Project

Enjoy these solutions? Help keep this project caffeinated!

Buy Me a Coffee

Your support fuels:
New problem solutions beyond #100
Performance optimizations
Educational explanations

Every coffee helps! 🙏


Table of Contents

  1. Project Euler Overview
  2. Solution Structure
  3. How to Run the Solutions
  4. Contributing
  5. License

Project Euler Overview

Project Euler is a collection of challenging mathematical/computer programming problems. The goal is to develop efficient algorithms to solve the problems in a limited time.

In this repository, I've solved problems 1 through 100. These solutions aim to be both accurate and efficient. Some problems require mathematical insights, while others focus on algorithmic complexity and optimization.

Solution Structure

Each problem has its own JavaScript file. The solutions are numbered according to the problem number (e.g., problem_1.js, problem_2.js, etc.). Inside each file, the solution for that specific problem is provided with a brief explanation of the approach used to solve it.

Example:

  • problem_1.js: Solution for Problem 1 - Multiples of 3 and 5
  • problem_2.js: Solution for Problem 2 - Even Fibonacci numbers
  • problem_3.js: Solution for Problem 3 - Largest prime factor
  • ...

How to Run the Solutions

To run the solutions locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Project-Euler-JS/project-euler-js.git  
  2. Navigate to the project directory:

    cd project-euler-js  
    cd problems  
  3. Run a solution (example with Problem 1):

    node problem_1.js  
  4. Install Node.js if needed:
    Download it from here.

Contributing

Contributions are welcome! If you have a more efficient solution or improvement:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Commit changes (git commit -m 'Add solution for problem X').
  4. Push to the branch (git push origin feature/your-feature-name).
  5. Open a pull request.

License

MIT License - see LICENSE.