Pregunta de entrevista de Snowflake

Find the longest subarray that equals K

Respuesta de la entrevista

Anónimo

26 abr 2018

I gave the naive approach which is O(n^2). But the interviewer gave prefix sum array and was expecting me to optimize the problem.