diff options
Diffstat (limited to 'progs/a734.py')
-rw-r--r-- | progs/a734.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/progs/a734.py b/progs/a734.py new file mode 100644 index 0000000..87acf69 --- /dev/null +++ b/progs/a734.py @@ -0,0 +1,8 @@ +def smallest_missing(A, left_element, right_element):
+ if left_element > right_element:
+ return left_element
+ mid = left_element + (right_element - left_element) // 2
+ if A[mid] == mid:
+ return smallest_missing(A, mid + 1, right_element)
+ else:
+ return smallest_missing(A, left_element, mid - 1)
\ No newline at end of file |