var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: how to get set of values from a number that is the result of multiple numbers left-sh
I'm trying to figure out how to get set of values from a number that is the result of multiple numbers left-shifted and added together.
I have a list of known values as such:
const VAL1 = 1
const VAL2 = 2
const VAL3 = 3
const VAL4 = 4
const VAL5 = 5
const VAL6 = 6
I'm being provided a number that is the addition of 1 or more left-shifted values. For example, I'm being provided this number:
How do I go about figuring out which values from my known list represent the 98? In this example, the values would be 2 (VAL2), 5 (VAL5), and 6 (VAL6) (since 1<<2 + 1<<5 + 1<<6 = 98)
Sorry to say but this looks like some school homework... But I'll give you a hint : this is very similar to the change-making problem...