Leetcode Similar Strings Hackerrank Solution Python Programming