how to find separate value length in array? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

how to find separate value length in array?

a=[1,1,1,2,2,2,2] in this array there are three(1) and 4(2) but now the question is what is the keyword or how to find the length of separate value in array?

12th Jun 2022, 8:11 AM
Naveen K
1 ответ
+ 3
Naveen K One solution is You can use map to store counted value with each key. https://code.sololearn.com/clJq45pF8okj/?ref=app
12th Jun 2022, 8:13 AM
A͢J
A͢J - avatar