Snowflake interview question

two lc hard one lc easy