Print Prime Factors of a Number
Advanced Maths DSA practice problem on Onlearn.
Difficulty: easy.
Topics: How can we print the prime factors of a given number?, Mathematical Algorithms, Prime Numbers, Divisors, Loops, Time Complexity, Space Complexity, Big O Notation, time complexity analysis, general programming, number theory, Prime Numbers, Longest Increasing Subsequence (LIS).
Problem Statement: Given a positive integer N, find all of its prime factors and print them in non decreasing order. Input Specification: The input consists of a single integer N (1 <= N <= 10^12). Output Specification: Print the prime factors of N separated by spaces. If N is 1, print nothing. Constraints: 1 <= N <= 10^12