Updated to use new library layout

This commit is contained in:
2021-07-14 15:38:17 -04:00
parent ad2e948a42
commit b5c1df010f
39 changed files with 316 additions and 493 deletions

View File

@@ -1,7 +1,7 @@
//ProjectEulerTS/Problems/Problem23.ts
//Matthew Ellison
// Created: 04-08-21
//Modified: 04-08-21
//Modified: 07-14-21
//Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/typescriptClasses
/*
@@ -22,8 +22,8 @@
*/
import { getDivisors, getSum } from "../../../Typescript/typescriptClasses/Algorithms";
import { Unsolved } from "../Unsolved";
import { getSum } from "../../../Typescript/typescriptClasses/ArrayAlgorithms";
import { getDivisors } from "../../../Typescript/typescriptClasses/NumberAlgorithms";
import { Problem } from "./Problem";
@@ -122,20 +122,17 @@ export class Problem23 extends Problem{
//Gets
//Returns the result of solving the problem
public getResult(): string{
if(!this.solved){
throw new Unsolved();
}
this.solvedCheck("result");
return `The answer is ${this.sum}`;
}
//Returns the sum of the numbers asked for
public getSum(): number{
if(!this.solved){
throw new Unsolved();
}
this.solvedCheck("sum");
return this.sum;
}
}
/* Results:
The answer is 4179871
It took an average of 7.798 seconds to run this problem through 100 iterations