1-2 lines Ruby/Python
Use binary search to find the first number that's less than or equal to the last.\n\n---\n\nRuby\n\nDirect translation of the above sentence into Ruby.\n\n    d
Use binary search to find the first number that's less than or equal to the last.\n\n---\n\n**Ruby**\n\nDirect translation of the above sentence into Ruby.\n\n    def find_min(nums)\n      nums.bsearch { |num| num <= nums.last }\n    end\n\n---\n\n**Python**\n\nA little hack.\n\n    class Solution:\n        def findMin(self, nums):\n            self.__getitem__ = lambda i: nums[i] <= nums[-1]\n            return nums[bisect.bisect(self, False, 0, len(nums))]
['Python', 'Ruby']