The Challenge
Given an integer input x
where 1 <= x <= 255
, return the results of powers of two that when summed give x
.
Examples
Given the input:
86
Your program should output:
64 16 4 2
Input:
240
Output:
128 64 32 16
Input:
1
Output:
1
Input:
64
Output:
64
The output may contain zeros if the certain power of two is not present in the sum.
For example, input 65
may output 0 64 0 0 0 0 0 1
.
Scoring
This is code-golf, so the shortest answer in each language wins.