Pergunta de entrevista da empresa Snowflake

Counting pairs which gave an array and integer