Skip to main content
Commonmark migration
Source Link

#Mathematica 75 69 68 bytes

Mathematica 75 69 68 bytes

Loquacious as usual. But Martin B was able to reduce the code by 7 bytes.

Method 1: Storing output in an Array

(68 bytes)

f@a_:=!Or@@(Join@@Array[a~Drop~{#}~StringStartsQ~a[[#]]&,Length@a]) 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False


Method 2: Storing output in a List

(69 bytes)

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 

#Mathematica 75 69 68 bytes

Loquacious as usual. But Martin B was able to reduce the code by 7 bytes.

Method 1: Storing output in an Array

(68 bytes)

f@a_:=!Or@@(Join@@Array[a~Drop~{#}~StringStartsQ~a[[#]]&,Length@a]) 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False


Method 2: Storing output in a List

(69 bytes)

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 

Mathematica 75 69 68 bytes

Loquacious as usual. But Martin B was able to reduce the code by 7 bytes.

Method 1: Storing output in an Array

(68 bytes)

f@a_:=!Or@@(Join@@Array[a~Drop~{#}~StringStartsQ~a[[#]]&,Length@a]) 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False


Method 2: Storing output in a List

(69 bytes)

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 
added 261 characters in body
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106

#Mathematica 75 69 6968 bytes

Loquacious as usual. But Martin B was able to reduce the code by 67 bytes.

Method 1: Storing output in an Array

(68 bytes)

f@a_:=!Or@@Flatten[a~Drop~Or@@(Join@@Array[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a],Length@a]) 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False


Method 2: Storing output in a List

(69 bytes)

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 

#Mathematica 75 69 bytes

Loquacious as usual. But Martin B was able to reduce the code by 6 bytes.

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False

#Mathematica 75 69 68 bytes

Loquacious as usual. But Martin B was able to reduce the code by 7 bytes.

Method 1: Storing output in an Array

(68 bytes)

f@a_:=!Or@@(Join@@Array[a~Drop~{#}~StringStartsQ~a[[#]]&,Length@a]) 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False


Method 2: Storing output in a List

(69 bytes)

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 
added 60 characters in body
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106

#Mathematica 7575 69 bytes

Loquacious as usual. But Martin B was able to reduce the code by 6 bytes.

f@a_:= !Or@@Flatten[Drop[a,Or@@Flatten[a~Drop~{#}]~StringStartsQ~a[[#]]&~StringStartsQ~a[[#]]&/@Range@Length@a]  

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False

#Mathematica 75 bytes

Loquacious as usual.

f@a_:= !Or@@Flatten[Drop[a,{#}]~StringStartsQ~a[[#]]&/@Range@Length@a]  

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False

#Mathematica 75 69 bytes

Loquacious as usual. But Martin B was able to reduce the code by 6 bytes.

f@a_:=!Or@@Flatten[a~Drop~{#}~StringStartsQ~a[[#]]&/@Range@Length@a] 

f@{"111", "010", "000", "1101", "1010", "1000", "0111", "0010", "1011", "0110", "11001", "00110", "10011", "11000", "00111", "10010"} 

True


f@{"He", "said", "Hello"} 

False

Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading