Untitled
public text v1 · immutablevoid recurse(int n, int m, char* stack, filled = 0)
{
if (b == filled)
{
display(stack, b);
return
}
if (filled == 0)
{
for (int x = 0; x < a - (b - filled); ++x)
{
stack[0] = 'a' + x;
recurse(a, b, stack, filled + 1);
}
return;
}
for (int x = stack[filled - 1] - 'a'; x < a - (b - filled); ++x)
{
stack[filled] = 'a' + x;
recurse(a, b, stack, filled + 1);
}
return;
}
stack = new char[3];
recurse(5, 3, stack)