My Java solution


  • -7
    A
    public class Solution {
        public int findMin(int[] nums) {
            
            
              Arrays.sort(nums);
         
            return nums[0];
        }
    }
    

    haha:0


  • 0
    A

    I can't understand the topic


  • 0
    N

    You need to use the concept of Binary search to solve this particular question.
    Put in another way, your solution will be solved in nlogn time but what if you are asked to solved this question in logn time?That is the reason of this exercise


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.