Math
1780. Check if Number is a Sum of Powers of Three
Given n, decide whether it's a sum of distinct powers of three (3^0, 3^1, …, each used at most once). The clean characterisation: this is possible if and only if the base-3 representation of n…
Loading…