public static int FindSubsequence(int[] array)
for (int i = 0; i < array.Length; i++)
for (int j = i + 1; j < array.Length; j++)
for (int k = j + 1; k < array.Length; k++)
if (sub[0] < sub[1] && sub[1] < sub[2] || sub[0] > sub[1] && sub[1] > sub[2])
public static void rotateImage(int[][] image)
for (int i = 0; i < mid; i++)
for (int j = 0; j < n; j++)
image[i][j] = image[n - 1 - i][j];
image[n - 1 - i][j] = temp;
for (int i = 0; i < n; i++)
for (int j = i; j < n; j++)
image[i][j] = image[j][i];
public static void Main()
int res = Program.FindSubsequence(array);
int[][] image = new int[n][];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
image[i][j] = i * n + j + 1;
Console.WriteLine("Printing Image: ");
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
Console.Write(image[i][j] + "\t");
Console.WriteLine("Printing Rotated Image: ");
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
Console.Write(image[i][j] + "\t");