Added solution to problem 4

This commit is contained in:
2020-10-24 13:24:23 -04:00
parent 180946eff3
commit e08a714687
2 changed files with 116 additions and 1 deletions

View File

@@ -27,11 +27,12 @@ import { Problem } from "./Problems/Problem";
import { Problem1 } from "./Problems/Problem1";
import { Problem2 } from "./Problems/Problem2";
import { Problem3 } from "./Problems/Problem3";
import { Problem4 } from "./Problems/Problem4";
export class ProblemSelection{
//Holds the valid problem numbers
public static PROBLEM_NUMBERS: number[] = [1, 2, 3];
public static PROBLEM_NUMBERS: number[] = [1, 2, 3, 4];
//Returns the problem corresponding to the given problem number
public static getProblem(problemNumber: number): Problem{
@@ -40,6 +41,7 @@ export class ProblemSelection{
case 1 : problem = new Problem1(); break;
case 2 : problem = new Problem2(); break;
case 3 : problem = new Problem3(); break;
case 4 : problem = new Problem4(); break;
}
return problem;
}