Code Monkey home page Code Monkey logo

coding_challenge's Introduction

Coding challenge by SG

The solutions to problems 1-6 are structured as the codingchallenge package. Each problem has its own module, named problemX, where X is the problem number. The method solve is available in each module and it returns the correct answer.

All problems can be tested at once with

python test.py

which prints not only the answers to each problem, but also the execution time in milliseconds (best of 5 runs).

Solutions

This is the output of test.py on my system (Linux + AMD Ryzen 4000)

problem 1: solution 376,	time (best of 5) = 8.184685 ms
problem 2: solution 21124,	time (best of 5) = 1.556899 ms
problem 3: solution 1064,	time (best of 5) = 0.027657 ms
problem 4: solution 1533776805,	time (best of 5) = 11.024844 ms
problem 5: solution 31626,	time (best of 5) = 54.881875 ms
problem 6: solution 4613732,	time (best of 5) = 0.003842 ms
problem 7: solution 26033,	time (best of 5) = 10015.359399 ms

N.B. the solution to problem 3 differs from the result posted on the instructions (1064 vs 1074). I believe this is a typo of the problem description, as I checked the result by hand as well.

coding_challenge's People

Watchers

 avatar

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.