educative.io

Memory is leaking

Optimal findSum() in this solution leaks memory if there’s no two elements that adds to ‘value’. Also we are not deleting memory in case there’s an answer. I know this is a toy example, but I think this should be pointed out.


Type your question above this line.

Course: https://www.educative.io/collection/5642554087309312/5646276079124480
Lesson: https://www.educative.io/collection/page/5642554087309312/5646276079124480/5739975890960384