PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000093. Tìm trong dãy xoay có phần tử trùng (Search 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
Tìm trong dãy xoay có phần tử trùng (Search in Rotated Sorted Array II)
Search in Rotated Sorted Array II
Source: LeetCode
Version: Phuoc Hung OJ Extended
Problem Statement
Given a cyclic rotation of a non-decreasing integer array that may contain duplicates, determine whether occurs.
Input
The first line contains ; the next line contains the rotated array.
Output
Print true if exists, otherwise false.
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
7 0
2 5 6 0 0 1 2
Output
true
Explanation
The target occurs at indices and , so output true.