Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void AppearOnce(int[,] m)
- {
- int[] arr = new int[m.Length];
- int count = 0, countApp = 0, k = 0, j = 0, row = 0, col = 0;
- while (j < m.GetLength(1))
- {
- countApp = row = col = 0;
- while (col < m.GetLength(1))
- {
- if (m[row, col] == m[j, k] && !(row == j && col == k))
- countApp++;
- row++;
- if (row == m.GetLength(0))
- {
- row = 0;
- col++;
- }
- }
- if (countApp == 0)
- {
- arr[count] = m[j, k];
- count++;
- }
- k++;
- if (k == m.GetLength(0))
- {
- k = 0;
- j++;
- }
- }
- for (int i = 0; i < count; i++)
- Console.Write(arr[i]);
- Console.WriteLine();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement