Skip to main content
deleted 22 characters in body
Source Link

C (gcc), 168 160 119119 114 bytes

-8 Thanks to @corvus_192 for pointing out newline separation between values was allowed, and a massive -41 thanks to @tsh, a further -5 thanks to @ceilingcat

f(lchar*l,*c;f(n,c,i)char*l;char*c;{if(!n)puts?(cc[n-1]=l[i]);else for(int j=0;j<strlen&&(l);j++)ifl[i]-c[n]&&f(!i||c[in-1]^l[j]1,0)c[i]=l[j],f(l,n-1,c,i+1)):puts(c);}g(le,n)char*l;char*e;{char c[n+1];fc=calloc(l,n,c2);l=e;f(n,c[n]=00);}

Try it online!Try it online!

Prints the newline separated output to STDOUT.

C (gcc), 168 160 119 bytes

-8 Thanks to @corvus_192 for pointing out newline separation between values was allowed, and a massive -41 thanks to @tsh

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the newline separated output to STDOUT.

C (gcc), 168 160 119 114 bytes

-8 Thanks to @corvus_192 for pointing out newline separation between values was allowed, and a massive -41 thanks to @tsh, a further -5 thanks to @ceilingcat

char*l,*c;f(n,i){n?(c[n-1]=l[i])&&(l[i]-c[n]&&f(n-1,0),f(n,i+1)):puts(c);}g(e,n)char*e;{c=calloc(n,2);l=e;f(n,0);}

Try it online!

Prints the newline separated output to STDOUT.

deleted 211 characters in body
Source Link

C (gcc), 168 160160 119 bytes

-8 Thanks to corvus_192@corvus_192 for pointing out newline separation between values was allowed, and a massive -41 thanks to @tsh

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the newline separated output to STDOUT.

It builds a n+1 sized char array, null terminates it in preparation for it being used to build the strings, then iterates recursively over l ignoring cases where the current index of our char array is equal to the character being iterated on in l.

C (gcc), 168 160 bytes

-8 Thanks to corvus_192 for pointing out newline separation between values was allowed

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the newline separated output to STDOUT.

It builds a n+1 sized char array, null terminates it in preparation for it being used to build the strings, then iterates recursively over l ignoring cases where the current index of our char array is equal to the character being iterated on in l.

C (gcc), 168 160 119 bytes

-8 Thanks to @corvus_192 for pointing out newline separation between values was allowed, and a massive -41 thanks to @tsh

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the newline separated output to STDOUT.

deleted 35 characters in body
Source Link

C (gcc), 168 160 bytes

-8 Thanks to corvus_192 for pointing out newline separation between values was allowed

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the spacenewline separated output to STDOUT with a trailing space but no newline.

It builds a n+1 sized char array, null terminates it in preparation for it being used to build the strings, then iterates recursively over l ignoring cases where the current index of our char array is equal to the character being iterated on in l.

C (gcc), 168 160 bytes

-8 Thanks to corvus_192 for pointing out newline separation between values was allowed

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the space separated output to STDOUT with a trailing space but no newline.

It builds a n+1 sized char array, null terminates it in preparation for it being used to build the strings, then iterates recursively over l ignoring cases where the current index of our char array is equal to the character being iterated on in l.

C (gcc), 168 160 bytes

-8 Thanks to corvus_192 for pointing out newline separation between values was allowed

f(l,n,c,i)char*l;char*c;{if(!n)puts(c);else for(int j=0;j<strlen(l);j++)if(!i||c[i-1]^l[j])c[i]=l[j],f(l,n-1,c,i+1);}g(l,n)char*l;{char c[n+1];f(l,n,c,c[n]=0);}

Try it online!

Prints the newline separated output to STDOUT.

It builds a n+1 sized char array, null terminates it in preparation for it being used to build the strings, then iterates recursively over l ignoring cases where the current index of our char array is equal to the character being iterated on in l.

added 90 characters in body
Source Link
Loading
Source Link
Loading