MeetCode
Squarefree Check
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Squarefree Check
Hard
Computer Mathematics
Primes & Factorization
35 views
Explanation
Complexity
Problem Statement
Print YES if n is squarefree (no prime square divides it).
Input Format
One integer n.
Output Format
YES or NO.
Example
Input
18
Output
NO
Constraints
2
Input / Output Format
Input Format
One integer n.
Output Format
YES or NO.
Constraints
2
Examples
Input:
18
Output:
NO
Example Solution (Public)
Computer Mathematics
Factor n; if any prime has exponent>=2 then NO else YES.
Official Solution Code
Wrap
Copy
Factor n; if any prime has exponent>=2 then NO else YES.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
18
Expected Output
NO
Compile Output
Error
Output
Please
login
to submit solutions.