Skip to content

Commit c72314e

Browse files
Adding in the toy problem of the day.
1 parent 844dba2 commit c72314e

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@
3232
1. Aug 12, 2016 - Euler Problem 029 - Distinct powers
3333
1. Aug 13, 2016 - Euler Problem 030 - Digit fifth powers
3434
1. Aug 14, 2016 - Euler Problem 031 - Coin sums
35+
1. Aug 15, 2016 - Euler Problem 032 - Pandigital products

euler-problem-032/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
2+
3+
The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
4+
5+
Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.
6+
HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.
7+
8+
[Source](https://projecteuler.net/problem=32)
9+
10+
# Dependencies
11+
1. npm
12+
1. node
13+
14+
To run Jasmine tests run
15+
```
16+
$ npm install
17+
$ npm test
18+
```

euler-problem-032/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "toy-problem",
3+
"version": "0.0.1",
4+
"description": "Just my daily toy problems.",
5+
"main": "src/problem.js",
6+
"scripts": {
7+
"test": "./node_modules/.bin/jasmine-node test/"
8+
},
9+
"author": "charlton.austin@gmail.com",
10+
"license": "MIT",
11+
"dependencies": {
12+
"jasmine-node": "^1.14.5"
13+
}
14+
}

euler-problem-032/src/problem.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var someFunction = () => {
2+
return 0;
3+
}
4+
5+
module.exports = {someFunction};

euler-problem-032/test/mySpec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(function () {
2+
'use strict';
3+
var problem = require('../src/problem.js');
4+
var someFunction = problem.someFunction;
5+
describe('someFunction', () => {
6+
it('should return 1', () => {
7+
expect(someFunction()).toBe(1);
8+
});
9+
});
10+
})();

0 commit comments

Comments
 (0)