Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Husk, (削除) 10 (削除ここまで) 9 bytes

-1 byte thanks to Zgarb

uSȯf¬`Bṁṡ

Try it online!

###Explanation

Explanation

 ṁṡ Concatenate together the symmetric ranges of each coefficient
 (It is guaranteed that the integer roots lie in the range [-n..n],
 where n is the coefficient with the largest magnitude)
 Sȯf Find all the values in that range which
 ¬ are zero
 `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)
u De-duplicate the roots

Husk, (削除) 10 (削除ここまで) 9 bytes

-1 byte thanks to Zgarb

uSȯf¬`Bṁṡ

Try it online!

###Explanation

 ṁṡ Concatenate together the symmetric ranges of each coefficient
 (It is guaranteed that the integer roots lie in the range [-n..n],
 where n is the coefficient with the largest magnitude)
 Sȯf Find all the values in that range which
 ¬ are zero
 `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)
u De-duplicate the roots

Husk, (削除) 10 (削除ここまで) 9 bytes

-1 byte thanks to Zgarb

uSȯf¬`Bṁṡ

Try it online!

Explanation

 ṁṡ Concatenate together the symmetric ranges of each coefficient
 (It is guaranteed that the integer roots lie in the range [-n..n],
 where n is the coefficient with the largest magnitude)
 Sȯf Find all the values in that range which
 ¬ are zero
 `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)
u De-duplicate the roots
added 207 characters in body
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57

Husk, 10(削除) 10 (削除ここまで) 9 bytes

-1 byte thanks to Zgarb

Sȯf¬`Boṡ►auSȯf¬`Bṁṡ

Try it online! Try it online!

###Explanation

 ṁṡ ►a GetConcatenate together the symmetric ranges of each coefficient with the largest absolute value: n
 oṡ(It is guaranteed that Getthe integer roots lie in the range [-n..n],
Sȯf where n is the coefficient with the largest magnitude)
 Sȯf Find all the values in that range which
 ¬ ¬ are zero
 `B `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)
u De-duplicate the roots

Husk, 10 bytes

Sȯf¬`Boṡ►a

Try it online!

###Explanation

 ►a Get the coefficient with the largest absolute value: n
 oṡ Get the range [-n..n]
Sȯf Find all the values in that range which
 ¬ are zero
 `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)

Husk, (削除) 10 (削除ここまで) 9 bytes

-1 byte thanks to Zgarb

uSȯf¬`Bṁṡ

Try it online!

###Explanation

 ṁṡ Concatenate together the symmetric ranges of each coefficient (It is guaranteed that the integer roots lie in the range [-n..n],
 where n is the coefficient with the largest magnitude)
 Sȯf Find all the values in that range which
 ¬ are zero
 `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)
u De-duplicate the roots
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57

Husk, 10 bytes

Sȯf¬`Boṡ►a

Try it online!

###Explanation

 ►a Get the coefficient with the largest absolute value: n
 oṡ Get the range [-n..n]
Sȯf Find all the values in that range which
 ¬ are zero
 `B when plugged through the polynomial
 (Base conversion acts as polynomial evaluation)

AltStyle によって変換されたページ (->オリジナル) /