HashedIn by Deloitte interview question

Maximum sum hourglass