Compute per-coin quarterly amounts and totals | Others Interview Question