mirror of
https://bitbucket.org/Mattrixwv/projecteulerts.git
synced 2025-12-06 17:43:59 -05:00
Updated to use new library layout
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user