Pergunta de entrevista da empresa Goldman Sachs

isPowerOfThree on leetcode was the easy question, I cannot remember the medium question.