MeetCode
Home
Doubts
Why is my C function not returning the …
Solved
1
49
Ask Doubt
View All Doubts
Solvers Leaderboard
Tutorials
Quiz
All Tests
Leaderboard
My Tasks
User Login
Dark
Enable Notifications
Toggle navigation
Euler Totient By Factorization
Computer Mathematics
Hard
3 views
Back to Questions
View Answer
0
Previous
No previous question
Next
Prime Check
Easy
N
Problem Description
Given n
Input Format
One integer n.
Output Format
phi(n).
Sample Test Case
Input:
36
Output:
12
Constraints
1
Official Solution
Factor n by trial up to sqrt. For each prime p, result = result/p*(p-1). If remaining >1 treat as prime.
Please
login
to submit solutions and comments.
Solutions (0)
No solutions submitted yet. Be the first!
Discussion (0)
No comments yet. Start the discussion!
Prev
Next
Fullscreen Editor
0 lines • 0 chars
Esc close • Tab indent
No comments yet. Start the discussion!