In this problem, a left single arrow is defined as a "less than" character ('<') immediately followed by zero or more consecutive hyphen characters ('-'). A left double arrow is a "less than" character ('<') immediately followed by zero or more consecutive equals characters ('='). A right single arrow is zero or more hyphen characters ('-') immediately followed by a "greater than" character ('>'). A right double arrow is zero or more equals characters ('=') immediately followed by a "greater than" character ('>'). For example, the following are arrows (quotes for clarity only): "==>", "<-", "<", "<===", "--->", ">". The length of an arrow is the number of characters it contains.
You will be given a String s. Return the length of the longest arrow in s, or -1 if it does not contain any arrows.
|