Hello everyone i have been trying to find a better approach to solve this instead of having allot of if checks...
so here is the problem:
say i have a matrix
8 1 6 3 5 7 4 9 2 [/CODE]
and i represent it as a list:
[CODE] 8 3 4 1 5 9 6 7 2 [/CODE]
what i want is to return the position of the number in the list. As inputs i get the indexes of the matrix. ie for i=1, j=3 (row, column) the value is 6 and the position in the list is 7 (list is from 1 to 9)
I am looking for a relationship between the indexes of the matrix and the position in the list if any exists
Question
Chester0
Hello everyone i have been trying to find a better approach to solve this instead of having allot of if checks...
so here is the problem:
say i have a matrix
and i represent it as a list:
8 3 4 1 5 9 6 7 2
[/CODE]
what i want is to return the position of the number in the list. As inputs i get the indexes of the matrix. ie for i=1, j=3 (row, column) the value is 6 and the position in the list is 7 (list is from 1 to 9)
I am looking for a relationship between the indexes of the matrix and the position in the list if any exists
cheers
Link to comment
Share on other sites
4 answers to this question
Recommended Posts