Possible Powers
CodeChefOpen on judge ↗
Given a string $S$ consisting of $N$ decimal digits, the task is to print all possible combinations of the digits of S( IN SORTED ORDER) that are perfect powers(which are less than or equal to 10^18) of given number $K$ (IF A VALID COMBINATION/PERFECT POWER OF K OCCURS MULTIPLE TIMES IN THE STRING THEN CONSIDER IT AS JUST A SINGLE COMBINATION, DUPLICATES SHOULD NOT BE CONSIDERED.) - (NOTE: CON
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