Provided I'm understanding this correctly you want to sum the A,B,C and D,E,F values.
The best method for this would be to reduce the current data into an associative array indexed by key and then sum manually from there. The snippet below implements the described behaviour.
I've been interviewing candidates for some time now.
We auto-send a very basic coding challenge to create a set of classes/methods to implement basic program (Shopping Cart, Tweet Parser, etc) with specific styling/linting requirements which acts as a nice sieve.
Once a candidate passes...