Skip to content

ronaldcs/sf-mb-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

You are given a function 'secret()' that accepts a single integer parameter and returns an integer. In your favorite programming language, write a command-line program that takes one command-line argument (a number) and determines if the secret() function is additive [secret(x+y) = secret(x) + secret(y)], for all combinations x and y, where x and y are all prime numbers less than the number passed via the command-line argument. Describe how to run your examples. Please generate the list of primes without using built-in functionality.

How to run:

  1. Visit https://repl.it/ByGK/4. Note that this link is essentially a duplicate of the coding-exercise.js file.

  2. Click on the "run" button.

  3. In the console, run the following command:

    ce.areAllPairsAdditive(<param>);

    Where <param> is the integer parameter of your choosing. Additionally, after running the above command, you can run the following command:

    ce._primes;

    to see the list of primes.

About

Coding Exercise in JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published