Array: Find Array Repet Element and count the quantity

1

Attached Files

The following files have been attached to this tutorial:

.c3p

findarrayrepetelement.c3p

Download now 160.86 KB

Stats

196 visits, 217 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 12 Jan, 2024.

Suppose, you have an array.

Apple
Apple
Banana
Mushroom
Carrot
Carrot
Mushroom
Pumpkin
Mushroom
Carrot
Apple
Durian
Pitaya
Peach

You want to count the repeated elements contained in this array and count the number of times they appear.

Solution:

use Dictionary object. when an element is first found, add it to the Key. If it appears again, increase the Value.

.C3P

findarrayrepetelement.c3p

Download now 160.86 KB
  • 0 Comments

Want to leave a comment? Login or Register an account!