Scala how can I count the number of occurrences in a list -


  wall list = list (1,2,4,2,4,7,3,2,4)  

I want to implement it like this: list.count (2) (return 3).

The mark is count in the archive: list.count (_ == 2)


Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -