Skip to main content
Commonmark migration
Source Link

#Pyth, 8 bytes

Pyth, 8 bytes

fq`;{`*Q 

Try it here.


#How?

How?

 fq`;{`*Q - Full program. f - First input where the condition is truthy over [1, ∞) *Q - The product of the input and the current number ` - Converted to String. { - Deduplicated. q - Is equal to? `; - The string representation of the innermost lambda variable, T, which is "10". - Output implicitly. 

This pretty much relies on the fact that numbers do not have trailing zeros, and 1 always occurs before 0 in a positive integer only consisting of 0s and 1s.

#Pyth, 8 bytes

fq`;{`*Q 

Try it here.


#How?

 fq`;{`*Q - Full program. f - First input where the condition is truthy over [1, ∞) *Q - The product of the input and the current number ` - Converted to String. { - Deduplicated. q - Is equal to? `; - The string representation of the innermost lambda variable, T, which is "10". - Output implicitly. 

This pretty much relies on the fact that numbers do not have trailing zeros, and 1 always occurs before 0 in a positive integer only consisting of 0s and 1s.

Pyth, 8 bytes

fq`;{`*Q 

Try it here.


How?

 fq`;{`*Q - Full program. f - First input where the condition is truthy over [1, ∞) *Q - The product of the input and the current number ` - Converted to String. { - Deduplicated. q - Is equal to? `; - The string representation of the innermost lambda variable, T, which is "10". - Output implicitly. 

This pretty much relies on the fact that numbers do not have trailing zeros, and 1 always occurs before 0 in a positive integer only consisting of 0s and 1s.

Source Link
Mr. Xcoder
  • 42.9k
  • 9
  • 87
  • 221

#Pyth, 8 bytes

fq`;{`*Q 

Try it here.


#How?

 fq`;{`*Q - Full program. f - First input where the condition is truthy over [1, ∞) *Q - The product of the input and the current number ` - Converted to String. { - Deduplicated. q - Is equal to? `; - The string representation of the innermost lambda variable, T, which is "10". - Output implicitly. 

This pretty much relies on the fact that numbers do not have trailing zeros, and 1 always occurs before 0 in a positive integer only consisting of 0s and 1s.