You are given a non-negative integer n. Your task is to return the length of the longest run of identical consecutive digits in the number.
A run is a sequence of two or more identical digits appearing consecutively. If no digit repeats consecutively, the longest run has a length of 1.
Input: n = 1112233
Output: 3
Explanation: The digit 1 appears three times consecutively, forming the longest run of length 3.
Input: n = 4455566
Output: 3
Explanation: The digit 5 appears three times consecutively, forming the longest run of length 3.
Input: n = 1234
Output: 1
Explanation: No digit repeats consecutively, so the longest run has a length of 1.
Sign in to write, run, and submit your solution against the full test suite.