← All problemsSign in

Number and Base

You are given two numbers $N$, $K$, output minimum number of numbers/characters required to represent the number $N$ in the $K$_th base number system If a number can’t be represented in Kth base number system output -1 NOTE: NUMBER ‘N’ IS A DECIMAL NUMBER, A DECIMAL NUMBER SYSTEM HAS BASE 10. Base of a number system is the total number of digits used in that number system. A number system wi

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start