2). Given an array which has random elements such that the value tells the number of hops that can be done from that index to the indices ahead, find if you can reach till the end of array. If the value for the hop is 0, that means you've hit a wall, and cannot go ahead, hence return false or not possible.
{ 2, 0, 3, 5, 1, 4, 2 } Here for the first element at 0th index "2", Two hops can be possible i.e either to 0 or 3. 0 means dead end so you have to select the highest values amongst the hopped positions in order to go ahead. If only 0 is the next option, then you will have to return not possible.