Hi,
   I am sorry for this late reply. The problem is more beautiful than this. First a small correction to your solution ( I hope you dont mind that :) )Look at this after setting the 2^(n-1) th one , You are left with only (n-2) ones so how you can only travel next 2^(n-2)-1 steps.
  Having said this, still the problem is not solved. Your assumption is reversing the steps is always possible, i am not sure abt this can you set the last bit alone in an array of size 4 using only 3 ones(just try it and you will get the trouble, u will need 4 ones is my hunch ) and similarly for setting the last bit in an array of size 8 u will need to have 5 ones and with 4 ones you can set the last bit ( but the other bits will also be set).
 I have given  a clue
 I think i am confusing every one also
 Well if i am not clear, Tell me I will post a reply when i am steady
 -karthik

Reply via email to