How to return an array position
Posted: 17 Apr 2018, 21:41
An array consist of seven elements,I want to return the position like this
Code: Select all
;if all the elements is the same return the first position
;return the first position of the elements which occur most
arr := [111, 111, 111, 111, 111, 111, 111] ;return 1
arr := [123, 111, 111, 111, 111, 111, 111] ;return 2
arr := [112, 119, 111, 111, 111, 111, 111] ;return 3
arr := [117, 116, 115, 111, 111, 111, 111] ;return 4
arr := [117, 118, 111, 111, 189, 111, 111] ;return 3
arr := [117, 119, 111, 111, 111, 111, 177] ;return 3