Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
split arguments on Repeated Permutations
Browse files Browse the repository at this point in the history
  • Loading branch information
Laifsyn committed Jun 9, 2024
1 parent 3158b5e commit a493669
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/utp/clsEstructuraDiscretas/pry4/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,13 @@ public Result<BigInteger, Exception> calcular(String n, String r) {
return Formulas.Varianza_sin_repeticion(new String[] { n, r });
}
case PERMUTACIONES_REPETIDAS -> {
return Formulas.Permutacion_con_repeticion(new String[] { n, r });
var split_r = r.split(",");
for (int i = 0; i < split_r.length; i++)
split_r[i] = split_r[i].trim();
String[] args = new String[split_r.length + 1];
args[0] = n;
System.arraycopy(split_r, 0, args, 1, split_r.length);
return Formulas.Permutacion_con_repeticion(args);
}
case COMBINACIONES_REPETIDAS -> {
return Formulas.Comb_con_repeticion(new String[] { n, r });
Expand Down

0 comments on commit a493669

Please sign in to comment.