Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void build(String [] array, String team, int size) {
- for (int i = 0; i < array.length; i++) {
- if (size == 0) {
- System.out.println(team);
- return;
- } else if (size > array.length) {
- return;
- } else {
- team += array[i];
- build(Arrays.copyOfRange(array, i + 1, array.length), team, size - 1);
- team = team.substring(0, team.length()-1);
- size += 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement