private static bool CanMergeArrays(int[] arr, ArrayBorders arrayBorders1, ArrayBorders arrayBorders2)
        {
            if (arrayBorders1.Right != arrayBorders2.Left - 1)
            {
                return(false);
            }

            if (arr[arrayBorders1.Right - 1] < arr[arrayBorders2.Left])
            {
                return(true);
            }

            if (arr[arrayBorders1.Right] < arr[arrayBorders2.Left + 1])
            {
                return(true);
            }

            return(false);
        }
 private static int Length(ArrayBorders arrayBorders) => arrayBorders.Right - arrayBorders.Left + 1;