Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Mohammed Dh Abbas
Concise solution

Mohammed Dh Abbas

Jul 22, 2024

class Solution: def decimalToBinary(self, num): stack = [] while num > 0: stack.append(str(num % 2)) num = num // 2 stack.reverse() return ''.join(stack)

0

0

Comments
Comments

On this page