GithubHelp home page GithubHelp logo

podandrea / toddmcleodgolangtraining Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikeaustin71/toddmcleodgolangtraining

0.0 0.0 0.0 7 KB

Todd McLeod Go Lang Course exercises and material

Go 100.00%

toddmcleodgolangtraining's Introduction

Golang Training Exercises

This Project Euler exercise was completed as part of the Udemy Training Course "Learn How To Code: Google's Go (golang) Programming", by Todd McLeod

Golang Course

Solution for Exercise 83-06 projecteuler.net problem

  • See ./Exercise_83_06_projecteuler/04/main.go for the high performance solution

  • Assignment: Find a problem at projecteuler.net then create the solution. Add a comment beneath your solution that includes a description of the problem. Upload your solution to github. Tweet me a link to your solution.

  • Send Tweet To Todd McLeod

  • Project Euler

Selected Problem: Problem 5 - Smallest Multiple

2520 is the smallest number that can be divided by each of the
numbers from 1 to 10 without any remainder. What is the smallest
positive number that is evenly divisible by all of the numbers
from 1 to 20?

Solutions

  • Solution - 1 Slowest brute force solution

    ./Exercise_83_06_projecteuler/01/main.go
    
  • Solution - 2 Modified brute force solution. Very slow for upper limits greater than 30

    ./Exercise_83_06_projecteuler/02/main.go
    
  • Solution - 3 Uses Prime Factors and uint64 numeric types. Very fast but fails when upper limits exceed 40. Failure is due to generated values greater than the bounds of uint64

    ./Exercise_83_06_projecteuler/03/main.go
    
  • Solution - 4 Uses Prime Factors and big.Int (math/big) numeric types. Very fast and capable of handling very large upper limit values. This is the preferred solution.

    ./Exercise_83_06_projecteuler/04/main.go
    

toddmcleodgolangtraining's People

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.