I wrote this code but got out of memory exception in the line if I am passing the range value 46542.
long[,] array = new long[range, range];
How to resolve this?
int noOfTestCases = Convert.ToInt32(Console.ReadLine());
if(noOfTestCases>=1 && noOfTestCases<=100)
{
for(int i=0; i<noOfTestCases; i++)
{
Console.WriteLine("Enter the Range");
long range = Convert.ToInt64(Console.ReadLine());
long[,] array = new long[range, range];
}
}