Here goes the solutions...
using 1st law of thermodynamics, since assuming no heat lost this
implies internal energy can only change via work done.
Many of u think along this line....I really lurve u ppl for being
so smart.
Now as heat supplied is equal, expansion is the same since the the
tension and the reaction force by the floor are equal(use newton
3rd law).
Now the tricky part is here.....as the floor sphere expand,it does
work against gravity as its centre of mass rises.
For the string's sphere, it does do equal work against the string
but its centre of mass DROP as it expands, hence the loss of
gravitational potential energy COMPENSATE the work done against the
string. Hence, the one on string loses no energy but the one on
floor loses energy as it work against gravity to expand which
causes a corresponding in its centre of mass...
Darkness is right to relate gravity with internal energy....