It seems test data is too weak .

  • 0
    class Solution:
    # @param {integer[]} nums
    # @return {integer}
    def findMin(self, nums):
        Min = nums 
        for i in nums :
            if i < Min :
                Min = i
        return Min

    Even the code like that could pass the test , I think manager should widen the range of test set .

  • 0

    I think what you mean is to detect the O(n) vs. O(log n) algorithm right ?. The above O(n) solution is correct though not the most efficient. And yes, in order to detect this you need to apply this to a large enough data set.

  • 0

    I think if this problem can be solved with the O(n) algorithm it should be classified to easy level . Anyway , thinks for replay :D

Log in to reply

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