I was asked 2 questions on heap.I wasable to solve one and optimize it and the next one I solved the brute force but could not do the optimization. 1st question was arrange a string in such a way that no 2 consecutive characters are together. 2nd was add ropes such that the time taken to add is minimum