Count Fancy Numbers
Asked at Hudson River Trading · Coding Questions · Difficulty: Medium
A number is **fancy** if, when written in **base-4**, it contains only the digits `0` and `1`. For example `17` is fancy because its base-4 form is `101` (only 0s and 1s), while `18` is not, because its base-4 form is `102` (contains a forbidden `2`).
Loading the problem…
More Hudson River Trading interview questions
- Buffer Readers for char/int/string with Pointer Advancement
- Heart Disease Prediction — EDA and Modeling
- Implement a Coroutine Step by Step
- C++ Template Wrapper over std::map and std::unordered_map
- Implement Modify in an Order Management System (Codebase Extension)
- Stock Buy Sell Position Indicator