T-Perm
Chef is sick of solving problems relating to binary representations of integers, so he decides to change things up — obviously, $3$ is larger than $2$, so [ternary](https://en.wikipedia.org/wiki/Ternary_numeral_system) *must* be better than binary. Chef thinks an integer is *good* if its ternary (that is, base $3$) representation contains the digit $2$. For example, $5, 6, $ and $14$ are *good*
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