I have simple method. I can't figure out why it throws an error. Thanks in advance!
public static int[] Shift(int[] a)
{
if (a == null) return -1;
...
}
Compiler throws the following error:
Cannot implicitly convert type
int
toint[]
if your array is null you are returning an int. The function is expecting an int[]. You can return null or a blank array.