Micro Focus QTP (UFT) Forums

Full Version: Find the number of occurrences of each number present in a matrix.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone please give me the solution for below general programming question,

How to print the number of occurrences of each number presnt in a matrix.

For examble:

x =

22 23 23 23

23 24 25 22

22 23 23 25


for the above matrix, it should print like below,

Code:
"Number 22 occurred 3 time"
"Number 23 occurred 6 time"
"Number 24 occurred 1 time"
"Number 25 occurred 2 time"
matrix is an array?
Yes it is a 2d array...