Question
Create a function in python using only strings and lists that takes in one string and returns an integer based on the amount of matching
Create a function in python using only strings and lists that takes in one string and returns an integer based on the amount of matching pairs, the function will keep looking for matching pairs until it runs into a pair that it cannot match. The string will try and match the pairs on the ends of the string so lets say a matches with b, g matches with h and d matches with r. The string "aghrhb" has two matching pairs since b and a match then g and h match once we get to r we see it does not match with h. Another example is "aghahghhrghb" this would have three matching pairs.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started