about | help | code help+videos | done | prefs |
We will define a number to be "sad", "happy" or "ecstatic" based on the digits of its base-4 representation. If none of these digits in base-4 are 3's the number is sad. If at least one of these digits is a 3 the number is happy. But if ALL the digits in base-4 are 3's the number is ecstatic. Return the correct string based on the positive integer input parameter. See test data for examples. baseFourSunflowerNumberAustralia(15) → "ecstatic" baseFourSunflowerNumberAustralia(13) → "happy" baseFourSunflowerNumberAustralia(2312) → "sad" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy