I have task where I need to print the occurrence and count and non-occurrence and count
import resequence = '1222311'm = re.search(r'(\d)\1+',sequence)print(m)
Exptected output :
(1, 1) (3, 2) (1, 3) (2, 1)
In sequence need to check and print
(cnt , val) -> 1222311 -> 1 as come only once -> (1,1) (cnt,number)