Write the logic to find repeated characters from a string.
Implement repeated_characters(s), returning a list of [character, count] pairs in the order each repeated character first appears. Matching is case-sensitive. For non-whitespace characters, count all occurrences; for whitespace characters, use the length of their longest contiguous run, so "a b c" reports two spaces.
Input: a string s. Output: a list of two-element lists, or [] when no character qualifies.
Examples: "programming" returns [["r", 2], ["g", 2], ["m", 2]]; "a b c" returns [[" ", 2]].
Constraints: 0 <= len(s) <= 1000; characters may include letters, digits, punctuation, and whitespace.
def repeated_characters(s):