code: public static Map.Entry<Object, Object> savage(DataTable2D payoffMatrix) {
          if(payoffMatrix.isValid()==false) {
              throw new IllegalArgumentException("The payoff matrix does not have a rectangular format.");
          }
          
          //Deep clone the payoffMatrix to avoid modifying its original values
          DataTable2D regretMatrix = new DataTable2D();
          
          for(Map.Entry<Object, AssociativeArray> entry : payoffMatrix.entrySet()) {
              Object event = entry.getKey();
              AssociativeArray optionList = entry.getValue();
              double maxI = Descriptives.max(optionList.toFlatDataCollection());
              
              for(Map.Entry<Object, Object> entry2 : optionList.entrySet()) {
                  Object option = entry2.getKey();
                  Double payoff = TypeInference.toDouble(entry2.getValue());
                  
                  //regretMatrix.internalData.get(event).internalData.put(option, payoff-maxI);
                  regretMatrix.put2d(event, option, payoff-maxI);
              }
          }
          
          return maxMin(regretMatrix);
      }
docs: Returns the best option and the payoff under savage strategy
  
  @param payoffMatrix
  @return