You are given N weights, the first weighs 1 pound, the second 2 pounds, and so on (the N weight weighs N pounds)ץ
You are given an N-binary-word that's formed by L's and R's and scales.
You need to provide an algorithm of N steps, which in each step puts a weight on on of the scales (the left or the right one), and that in the i-th step the scales will lean left if the i-th letter in the word is L and will lean right if it's R.
for example: if N=3 and the word is LLR then the algorithm should say:
1. put 2 on the left scale
2. put 1 on the right scale (the scales will still lean to the left)
3. put 3 on the right scale