I do not understand why this for loop is throwing exception. starting index is 0 and and index of inputStringArray is 4 so I really do not get it.
Console.WriteLine("please enter several numbers separated by hyphen");
var input = Console.ReadLine();
var inputStringArray = input.Split('-');
var listOfNumbers = new List<int>();
for (int i = 0; i < inputStringArray.Length; i++)
{
listOfNumbers[i] = Convert.ToInt32(inputStringArray[i]);
}