PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000094. Cực tiểu trong dãy xoay có trùng lặp (Find Minimum in Rotated Sorted Array II)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Cực tiểu trong dãy xoay có trùng lặp (Find Minimum in Rotated Sorted Array II)
Find Minimum in Rotated Sorted Array II
Source: LeetCode
Version: Phuoc Hung OJ Extended
Problem Statement
Given a cyclic rotation of a non-decreasing array possibly containing duplicates, return the minimum value.
Input
The first line gives ; the next line contains the rotated values.
Output
Print the minimum value.
Subtasks
- Subtask 1 (20 points): ; ; a cyclic rotation of a non-decreasing array, duplicates permitted.
- Subtask 2 (30 points): ; ; a cyclic rotation of a non-decreasing array, duplicates permitted.
- Subtask 3 (50 points): ; ; a cyclic rotation of a non-decreasing array, duplicates permitted.
Examples
Input
5
2 2 2 0 1
Output
0
Explanation
The smallest value of is .