PayPal interview question

SQL window functions on HackerRank