How do I find the total number of duplicates in a string?
i.e., if it was `j= [1,1,1,2,2,2]` it would find `4` duplicates?
I've only been able to find counting which shows how many times each individual number occurred.