private static boolean search(char[][] arr, int x, int y, Set<Integer> removed) {
    for (int i = y - 1; i >= 0; i--) {
      if (!removed.contains(i)) {
        if (arr[x][i] > arr[x - 1][i]) {
          return true;
        }
      }
    }
    return false;
  }