Magic Prime
CodeChefOpen on judge ↗
Problem description: You are given an array of some distinct numbers . All you have to do is print an resulting 0-indexed array in which the Prime Numbers are placed at prime positions and composite at composite positions. But it creates a problem for 0th and 1th index so place “0”(without qoutes) there. And place “0”(without qoutes) in empty places. Input: The first line will contain n the s
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start