TikTok Interview Question

Select proper pseudocode implementation of max pq