You are given a string S consisting of lowercase English letters and digits, where the letters represent items and the digits represent packaging lines. You have to count how many items are wrapped by packaging lines, i.e., how many letters have a digit on the left and a digit on the right in the string. Your task is to find and return an integer value representing the number of items wrapped in packaging lines.
The input string S will only contain lowercase English letters and digits (0-9).
input1: A string S containing only lowercase English letters and digits (0-9).
Return an integer value representing the number of items wrapped in packaging lines.
Input: input1 = "1a2b3c4d5" Output: 4
Explanation: Here, the string S is "1a2b3c4d5". We can find the wrapped items as below:
Input: input1 = "5aart6i7io8o5o56" Output: 3
Explanation: Here, the string S is "5aart6i7io8o5o56". We can find the wrapped items as below:
Hard