Snowflake interview question

LC Medium + some React (OA)