C++||  4 Ms Easy Solution explained by Aditya Verma ji
\n    \n\t\n\t/Solution explained by aditya verma:\n\tCode explanation:\n\tSince our aim is to find the element in a rotated sorted array... the code when done 
\n    \n\t\n\t/*Solution explained by aditya verma:\n\tCode explanation:\n\tSince our aim is to find the element in a rotated sorted array... the code when done by \n\tsorting and returning the first element will also get accepted or traversing the vector and \n\treturning the minimum will also get accepted but the complexities will be O(nlogn) and \n\tO(n) respectively. But we have to write a solution of O(logn) time complexity....\n\tSo here we are comparing the mid with its previous and next element (so when a element with \n\tminimum value should be less than both the next and previous if that is the case we will return \n\tthe mid or else as we can see in video we have to move to unsorted side so compare the mid with \n\tits start if nums[start]<=nums[mid] we will move to the other side or else if \n\tnums[mid]<=nums[end]  so move to the area of [start.....mid-1].\n\t*/\n\t/*****but aditya ji forgot to mention this point that is if nums[start]<nums[end] that is vector\n\tis already sorted we return the first element as it will be the minimum.***/\n\t/*So when this condition is added the solution will get accepted and its time complexity will be\n\tO(logn)*/\n\t\n\tint n=nums.size();\n        int start=0;\n        int end=n-1;\t\n        while(start<=end){\n            if(nums[start]<nums[end]) return nums[start];\n            int mid=start+(end-start)/2;\n            int next=(mid+1)%n;\n            int prev=(mid-1+n)%n;\n            if(nums[mid]<=nums[end] && nums[mid]<=nums[prev]){\n                return nums[mid];\n            }\n             if(nums[start]<=nums[mid]){\n                start=mid+1;\n            }\n            if(nums[mid]<=nums[end]){\n                end=mid-1;\n            }\n        }\n        return 0;\n            \n            /*THANKS FOR YOUR VIEW*/
['Binary Search', 'C']