Ok, first of all, the answer is correct.
For what concerns the first molecule, the oxidation number is worked out in the following way: oxygen has -2 has oxidation number and there are seven atoms; hence, -14.
There are 2 cations (NH4+): hence, +2
The difference is +12, but there are 2 chromium: hence, Cr is +6.
I think you can find useful to use this scheme for understanding why your answer is correct.