read an array in Heap and make sum rotate elements