R, (削除) 116 (削除ここまで) 107(削除) 107 (削除ここまで) 95 bytes
R+pryr
pryr::f(for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(paste(t,collapse="")sep="")
break}))
base R
function(v)for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(paste(t,collapse="")sep="")
v=0})
These two variants saving 9 bytes thanks to Giuseppe.
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function with break to halt the loop, or base R function zeroing the vector to break the loop.
R, (削除) 116 (削除ここまで) 107 bytes
R+pryr
pryr::f(for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(paste(t,collapse=""))
break}))
base R
function(v)for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(paste(t,collapse=""))
v=0})
These two variants saving 9 bytes thanks to Giuseppe.
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function.
R, (削除) 116 (削除ここまで) (削除) 107 (削除ここまで) 95 bytes
R+pryr
pryr::f(for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(t,sep="")
break}))
base R
function(v)for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(t,sep="")
v=0})
These two variants saving 9 bytes thanks to Giuseppe.
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function with break to halt the loop, or base R function zeroing the vector to break the loop.
- 19.4k
- 5
- 29
- 78
R, 116(削除) 116 (削除ここまで) 107 bytes
R+pryr
pryr::f(for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{t=ccat(paste(t,collapse=""))
break}))
base R
function(v)for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),""0,{cat(paste(t,collapse=""))
break})v=0})
These two variants saving 9 bytes thanks to Giuseppe .
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function.
R, 116 bytes
pryr::f(for(i in 1:min(nchar(v))){t=c()
`if`(anyDuplicated(t<-substr(v,i,i)),"",{cat(paste(t,collapse=""))
break})})
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function.
R, (削除) 116 (削除ここまで) 107 bytes
R+pryr
pryr::f(for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(paste(t,collapse=""))
break}))
base R
function(v)for(i in 1:min(nchar(v)))`if`(anyDuplicated(t<-substr(v,i,i)),0,{cat(paste(t,collapse=""))
v=0})
These two variants saving 9 bytes thanks to Giuseppe .
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function.
R, 116 bytes
pryr::f(for(i in 1:min(nchar(v))){t=c()
`if`(anyDuplicated(t<-substr(v,i,i)),"",{cat(paste(t,collapse=""))
break})})
Explanation:
This effectively truncates all stings in the vector v to the length of the shortest and iterates through subsequent indexes. Then checks whether there are any duplicates within chosen letters and if not, pastes them together and prints with cat. If all indexes return duplicated results, this prints empty string.
All wraped in an anonymous pryr function.