Added solution to problem 3

This commit is contained in:
2020-10-19 18:13:46 -04:00
parent eeb927d1e5
commit 180946eff3
4 changed files with 106 additions and 2 deletions

View File

@@ -26,11 +26,12 @@ const readlineSync = require("readline-sync");
import { Problem } from "./Problems/Problem";
import { Problem1 } from "./Problems/Problem1";
import { Problem2 } from "./Problems/Problem2";
import { Problem3 } from "./Problems/Problem3";
export class ProblemSelection{
//Holds the valid problem numbers
public static PROBLEM_NUMBERS: number[] = [1, 2];
public static PROBLEM_NUMBERS: number[] = [1, 2, 3];
//Returns the problem corresponding to the given problem number
public static getProblem(problemNumber: number): Problem{
@@ -38,6 +39,7 @@ export class ProblemSelection{
switch(problemNumber){
case 1 : problem = new Problem1(); break;
case 2 : problem = new Problem2(); break;
case 3 : problem = new Problem3(); break;
}
return problem;
}