
You are given a string s containing words separated by spaces. Your task is to find and return the first word in the string that satisfies two conditions:
If multiple words of the same maximum even length exist, you must return the one that appears first in the original string.
A single line containing the string s.
Print a single string which is the first longest even-length word.
If no even-length words are found in the string, print "00".
A word is a sequence of non-space characters.
Multiple spaces between words, as well as leading/trailing spaces, should be handled correctly.
You are given an array of n numbers
an
The even-length words in the string are "an" (length 2) and "of" (length 2).
The maximum even length is 2.
Since both "an" and "of" have this length, we choose the one that appears first, which is "an".
odd words only
00
All words ("odd", "words", "three") have odd lengths. Since no even-length words exist, the output is "00".
The expected time complexity is O(N), where N is the length of the string.
1 <= length of s <= 10^5
The string consists of lowercase English letters and spaces.
Time limit: 1 sec