Please verify is it heptane or hexane because I have not heard about hectane;
The C=O reacts with H2NNH2 (hydrazine) to form C=N-NH2
This on reaction with HgO can form Hg2O + H2O with carbon carrying a negative charge
Both the carbon atoms of the carbonyl groups( present on 1,2 carbon atoms) can now overlap to form carbon-carbon triple bond.Thus giving the product cyclohexyne(like benzyne).
You can get the mechanism of reduction of carbonyl group to CH2 by NH2NH2 in presence of basic medium (Wolf-Kishner reduction); refer to last step where a carbanion is formed, prior to formation of CH2, the carbaion on adjacent carbon can now form the triple bond.