Snowflake Interview Question

two lc hard one lc easy