CVS Health interview question

Leetcode - Easy-Medium and a SQL question