Работает код, а выдает вот это говно:
Unhandled Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at MainClass.Main () [0x00012] in <26cf4fdb61b641edb52a427804b1c941>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at MainClass.Main () [0x00012] in <26cf4fdb61b641edb52a427804b1c941>:0
А что не понятно? Выход за границы диапазона! Попытка обраться к элементу множества, которого нет