First we need to find the number of moles of both K and O reacted
K - 0.779 g / 39 g/mol
= 0.02 mol
the mass of O₂ reacted = 1.417 g - 0.779 g = 0.638 g
O₂ moles = 0.638 g / 32 g/mol
= 0.02 mol
the number of both K and O₂ moles reacted are equal
therefore stoichiometry of K to O₂ reacted are 1:1
then the formula of potassium superoxide is KO₂