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

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

asp.net - MVC [HandleError] HandleErrorAttribute called twice when using global logging -