Added time complexity for each method in the comments.
To test the solution run the Program.cs file