First And Last Occurrence Of An Element Leetcode