8000 GitHub - hackhat/semasio-test: Given an array of integers, find the maximum product between two numbers from the array, that is a multiple of 3.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Given an array of integers, find the maximum product between two numbers from the array, that is a multiple of 3.

Notifications You must be signed in to change notification settings

hackhat/semasio-test

Repository files navigation

semasio-test Build Status Coverage Status

This is a entry test for semasio.

Requirements

  • Given an array of integers, find the maximum product between two numbers from the array, that is a multiple of 3.
  • The result for the input {6,8,8,7,2,5} should be 48 = 68. Note that 88 is the greatest product (64) but 64 isn't divisible by 3.
  • Given the input {1,9,2,4} the result should be 36 = 94, and not 81 (99) since you should't multiply a number by itself.
  • Should has a O(n) time complexity instead of O(n^2);

Results

Test completed successfully and does what has been requested. Tests cover Coverage Status of the application.

Relevant files

API

The API is here.

Install

  • Make sure you already have node.js installed;
  • Install mocha and istanbul globally npm install mocha istanbul -g;
  • Clone the project in a folder (let's say "semasio-test");
  • Open a command line and cd into the folder;
  • Run the command npm install;

Run it

  • Run tests: mocha;
  • Run tests with code coverage: npm test;

About

Given an array of integers, find the maximum product between two numbers from the array, that is a multiple of 3.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0