bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumMath & GeometryLC 1017

Convert to Base -2

Given an integer n, return a binary string representing its representation in base -2. Note that the returned string should not have leading zeros unless the string is "0 ".

Asked at 2 companies
AirbnbGrab
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode