code: public boolean isSolution(Configuration configuration) {
          try {
              boolean[] presenceMap = new boolean[this.dimension];
              Arrays.fill(presenceMap, false);
  
              for (int i = 0; i < this.dimension; ++i) {
                  if (presenceMap[configuration.valueAt(i)]) return false;
                  presenceMap[configuration.valueAt(i)] = true;
              }
          } catch (IndexOutOfBoundsException e) {
              return false;
          }
  
          return true;
      }
docs: Problem Interface