Two Pointer Problems Interviewbit React