August 27, 2024
P35 - Determine the prime factors of a given positive integer.
Construct a flat list containing the prime factors in ascending order.
scala
scala> 315.primeFactors
res0: List[Int] = List(3, 3, 5, 7)
August 27, 2024
Construct a flat list containing the prime factors in ascending order.
scala
scala> 315.primeFactors
res0: List[Int] = List(3, 3, 5, 7)
Don't have an account? We will create one for you.
Enter the OTP send to
in seconds. Check your spam folder if you can't find email from us.
Valid email is required for further communications