HashedIn by Deloitte Interview Question

Maximum sum hourglass