How does a for-each loop works when it calls a method, either recursively or a different method?
Example:
for(String permutation : permute(remaining))
{
// Concatenate the first character with the permutations of the remaining chars
set.add(chars.charAt(i) + permutation);
}
By the way the method permute takes in a String and returns a set.
Thank you.