generated from rayraydejesus/LeetCode-CSharp-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
38 lines (31 loc) · 966 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to the Leet Code console app!");
string input = "";
int key = -1;
while(true)
{
Console.WriteLine("\nPlease input the number of the question you'd like to see.");
input = Console.ReadLine();
if(int.TryParse(input, out key))
{
Console.Clear();
ILeetCodeProblem problem = ProblemsIndex.retrieveProblem(key);
if (problem == null)
Console.WriteLine("\nProblem " + key + " is currently unavailible.");
else
problem.runProblem();
}
else
{
Console.WriteLine("\nInvalid response.");
}
if (!Prompts.oneMoreTime())
break;
}
Console.WriteLine("\nGoodbye!");
}
}