Str1ke
Str1ke
CC#
Created by Str1ke on 9/29/2023 in #help
❔ I made a function to check that there is no Same last variable in two queues in the queue array
}
4 replies
CC#
Created by Str1ke on 9/29/2023 in #help
❔ I made a function to check that there is no Same last variable in two queues in the queue array
public static bool NoSameLast(Queue<int>[] arr) { Queue<int> queue = new Queue<int>(); for (int i = 0; i < arr.Length; i++) { int last= 2; int secondlast= -2; while (!arr[i].IsEmpty()) { int x = arr[i].Remove(); queue.Insert(x); last = x; } while (!queue.IsEmpty()) { arr[i].Insert(queue.Remove()); } for (int x = i+1; x < arr.Length;i++) { while (!arr[x].IsEmpty()) { int y = arr[x].Remove(); queue.Insert(y); secondlast = y; } while (!queue.IsEmpty()) { arr[x].Insert(queue.Remove()); } if (last == secondlast) { return false; } } } return true;
4 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
Thank you!
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
omg
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
Oh
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
it will show error?
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
and I loop till like 8
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
Wait, if like let's say the int[] size is 5
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
yes
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
nvm
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
yeah
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
oh wait
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
Else it's false
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
arr + brr length must be equal to crr length
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
still the same error
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
I changed the code
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
@phaseshift
public static bool IsMerged(int[] arr, int[] brr, int[] crr)
{
if (crr.Length != arr.Length + brr.Length)
return false;
int[] zrr = new int[999];
int[] trr = new int[999];
for (int i = 0; i < crr.Length; i++)
{
zrr[crr[i]]++;
trr[arr[i]]++;
trr[brr[i]]++;
}

for(int x = 0; x < crr.Length; x++)
{
if (trr[x] != zrr[x])
return false;
}
return true;
}
public static bool IsMerged(int[] arr, int[] brr, int[] crr)
{
if (crr.Length != arr.Length + brr.Length)
return false;
int[] zrr = new int[999];
int[] trr = new int[999];
for (int i = 0; i < crr.Length; i++)
{
zrr[crr[i]]++;
trr[arr[i]]++;
trr[brr[i]]++;
}

for(int x = 0; x < crr.Length; x++)
{
if (trr[x] != zrr[x])
return false;
}
return true;
}
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
I see, thank you!
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
it will let me?
40 replies
CC#
Created by Str1ke on 1/29/2023 in #help
❔ I keep getting an error " Index was outside the bounds of the array"
and if let's say I make an array of a 1000
40 replies