Added solution to problem 2

This commit is contained in:
2020-10-19 10:51:40 -04:00
parent 30c0201838
commit 3af5e824e1
2 changed files with 99 additions and 2 deletions

View File

@@ -25,17 +25,19 @@
const readlineSync = require("readline-sync");
import { Problem } from "./Problems/Problem";
import { Problem1 } from "./Problems/Problem1";
import { Problem2 } from "./Problems/Problem2";
export class ProblemSelection{
//Holds the valid problem numbers
public static PROBLEM_NUMBERS = [1];
public static PROBLEM_NUMBERS: number[] = [1, 2];
//Returns the problem corresponding to the given problem number
public static getProblem(problemNumber: number): Problem{
let problem: Problem = null;
switch(problemNumber){
case 1 : problem = new Problem1(); break;
case 1 : problem = new Problem1(); break;
case 2 : problem = new Problem2(); break;
}
return problem;
}