30秒学会 Golang 片段 – GCD
Calculates the greatest common divisor between two or more numbers. Define a gcd() function for two ...
Calculates the greatest common divisor between two or more numbers. Define a gcd() function for two ...
Converts Fahrenheit to Celsius. Follows the conversion formula C = (F – 32) * 5/9.
Returns the average of a list, after mapping each element to a value using the provided function. Us...
Returns the least common multiple of a list of numbers. Use functools.reduce(), math.gcd() and lcm(x...
Returns the minimum value of an array, after mapping each element to a value using the provided func...
Returns the minimum value of a list, after mapping each element to a number using the provided funct...
Converts an angle from radians to degrees. Use math.pi and the radian to degree formula to convert t...
Returns the logical inverse of the given value. Use the logical not (!) operator to return the inver...
Returns the nth term of the Fibonacci sequence. Use recursion to calculate the nth term in the Fibon...
Returns the distance between two vectors. Use Array.prototype.reduce(), Math.pow() and Math.sqrt() t...