docs: public static int[] calculateIndexesInDuplicateArray(int[] originalUserPages) {
          int[] result = new int[originalUserPages.length];
          if (originalUserPages.length == 0) {
              return result;
          }
  
          int index = 0;
          result[0] = originalUserPages[0];
          for (int i = 1; i < originalUserPages.length; i++) {
              if (originalUserPages[i] != originalUserPages[i - 1]) {
                  index++;
              }
              result[i] = index;
          }
  
          return result;
      }