Top "Counting" questions

Counting is the action of finding the number of elements of a finite set of objects.

Counting digits using while loop

I was recently making a program which needed to check the number of digits in a number inputted by the …

c++ while-loop digits counting
Counting regex pattern matches in one line using sed or grep?

I want to count the number of matches there is on one single line (or all lines as there always …

regex bash sed grep counting
Counting the number of occurrences of a string within a string

What's the best way of counting all the occurrences of a substring inside a string? Example: counting the occurrences of …

c++ string counting
Count specific values in multidimensional array

I'm trying to count the number of times a certain value appears in my multidimensional array based on a condition. …

php multidimensional-array counting
Python algorithm of counting occurrence of specific word in csv

I've just started to learn python. I'm curious about what are the efficient ways to count the occurrence of a …

python algorithm csv counting
Counting the number of occurrences of words in a textfile

How could I go about keeping track of the number of times a word appears in a textfile? I would …

c algorithm nlp counting
How to count the consecutive duplicate values in an array?

I have an array like this: $arr = array(1, 1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3); I found the function array_count_values(), but it will group all …

php arrays duplicates grouping counting
Count the number of Ks between 0 and N

Problem: I have seen questions like: count the number of 0s between 0 and N? count the number of 1s between 0 …

algorithm numbers range time-complexity counting
SQL - counting number of logins per day, per user

I have a query that produces a table like the following: Login_Date Username ---------------------------------------------- 1/1/10 user-1 1/1/10 user-1 1/1/10 user-2 1/2/10 user-1 1/2/10 user-2 1/3/10 …

mysql date counting
perl: count unique elements in array

I have a simple array with names in it, and I want to be able to easily print out the …

arrays perl counting