algorithm questions in leetcode