Snowflake Interview Question

3 Questions. All can solved by dp.