How do I specify a custom code for comparison when finding a minimal element in my Array?
For example, I have two arrays:
int[] a = new int[] {3, 6, 8};
int[] b = new int[] {9, -2, 5};
I want to figure out, what would be the minimal ratio of the elements with respective indexes (i.e. find minimum of 3/9
, 6/(-2)
and 8/5
) and then return the index. I m already aware of Array.Min(), but I wonder if it s possible to make any sort of it s customization.