using System.Collections.Generic;
public static void Main(string[] args)
string[] strArray = new string[]{"a","b","c"};
#region delete any value in array O(n^2) OR O(n)
for(var i=0; i< strArray.Length; i++){
strArray[i-1] = strArray[i];
Array.ForEach<string>(strArray, s=> {
Array.Resize<string>(ref strArray, strArray.Length -1);
Console.WriteLine(strArray.Length);
static bool Question2Explained(List<int> T, int k)
bool result = Math.Abs(T[i] + T[r] - k) <= 2;
Console.WriteLine("| " + T[i] + " + " + T[r] + " - " + k + " | = " + (T[i] + T[r] - k) + " <= 2 ? " + result);
Console.WriteLine("T[r] (" + T[r] + ") is too large, we must decrease the sum. (r--)");
Console.WriteLine("T[i] (" + T[i] + ") is too small, we must increase the sum (i++)");
Console.WriteLine("T[i] AND T[r] are larger than k, we must decrease r");
static bool Question2Pure(List<int> T, int k)
if (Math.Abs(T[i] + T[r] - k) <= 2) return true;