Naive solution for Find the Min problem. Still too slow to submit...