Count Strings Hackerrank Solution Python Snake