first and second min in array
added error check (what if no repeating element)