Skip to main content
golfed code some more
Source Link
qdread
  • 509
  • 2
  • 12

R, 119 112 106 106103 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()
-6 bytes to only call strsplit() once at the beginning
-3 bytes to get rid of the aliasing again and assign two variables in one call

(Also edited the byte count which was erroneously low earlier)

a=scan(,'');u=unlist;a=strsplit;b=a=strsplit(a,'');b=a[1];for;for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(u(a[i])a[[i]],uunlist(bb[1:i-1]));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

R, 119 112 106 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()
-6 bytes to only call strsplit() once at the beginning

(Also edited the byte count which was erroneously low earlier)

a=scan(,'');u=unlist;a=strsplit(a,'');b=a[1];for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(u(a[i]),u(b));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

R, 119 112 106 103 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()
-6 bytes to only call strsplit() once at the beginning
-3 bytes to get rid of the aliasing again and assign two variables in one call

(Also edited the byte count which was erroneously low earlier)

a=scan(,'');b=a=strsplit(a,'');for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(a[[i]],unlist(b[1:i-1]));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

golfed code and fixed error in byte count
Source Link
qdread
  • 509
  • 2
  • 12

R, 78119 112 71106 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()
-6 bytes to only call strsplit() once at the beginning

(Also edited the byte count which was erroneously low earlier)

a=scan(,'');s=strsplit;u=unlist;b=s;u=unlist;a=strsplit(a[1]a,'');for;b=a[1];for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(u(s(a[i],'')),u(b));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

R, 78 71 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()

a=scan(,'');s=strsplit;u=unlist;b=s(a[1],'');for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(u(s(a[i],'')),u(b));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

R, 119 112 106 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()
-6 bytes to only call strsplit() once at the beginning

(Also edited the byte count which was erroneously low earlier)

a=scan(,'');u=unlist;a=strsplit(a,'');b=a[1];for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(u(a[i]),u(b));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

removed 7 bytes from code and added explanation
Source Link
qdread
  • 509
  • 2
  • 12

R, 7878 71 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()

z=functiona=scan(a,b=strsplit'');s=strsplit;u=unlist;b=s(a[1],'')){for;for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(unlistu(strsplits(a[i],'')),unlistu(b));b} 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The code is a function definition and the output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, ifit takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

R, 78 bytes

z=function(a,b=strsplit(a[1],'')){for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(unlist(strsplit(a[i],'')),unlist(b));b} 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The code is a function definition and the output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, if there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

R, 78 71 bytes

-7 bytes from aliasing the two longer function names and now taking user input from scan()

a=scan(,'');s=strsplit;u=unlist;b=s(a[1],'');for(i in 2:length(a))b[[i]]=vecsets::vsetdiff(u(s(a[i],'')),u(b));b 

This is my very first PPCG submission of any kind! So I have no idea what I'm doing both in terms of golfing and in terms of posting etiquette. The output is a list of vectors which may or may not meet the terms of the challenge. :-P

As for the code itself, it takes user input via scan() and compares each new day's letters to the cumulatively owned letters, as in other solutions. If there are shorter alternatives to unlist and strsplit for converting strings into vectors of individual characters that would be cool to know. I also used the vsetdiff function in Carl Withoft's vecsets package to get the set difference of the letters needed for the next day and the current letters owned.

Source Link
qdread
  • 509
  • 2
  • 12
Loading