Find Longest String Leetcode Problems Python