nvimdojo
0 day practice streak

Free Practice

Playground

A keyboard-driven Neovim simulator with no goal. Try motions and edits freely; nothing is graded.

Binary search.py
1def binary_search(arr, target):
2    """Return the index of target in sorted arr, or -1."""
3    low, high = 0, len(arr) - 1
4    while low <= high:
5        mid = (low + high) // 2
6        if arr[mid] == target:
7            return mid
8        if arr[mid] < target:
9            low = mid + 1
10        else:
11            high = mid - 1
12    return -1
13 
14 
15numbers = [1, 3, 5, 7, 9, 11]
16print(binary_search(numbers, 7))
NORMAL hjkl move · wbe words · x delete · dd line · i insert · Esc normal · u undo

Keyboard Required

The Playground Needs a Real Keyboard.

Open nvimdojo on a desktop or laptop to practice real Neovim input.

Back to the Dojo