> For the complete documentation index, see [llms.txt](https://wenbo-notes.gitbook.io/coding/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wenbo-notes.gitbook.io/coding/kattis/easy/bottle-opening.md).

# Bottle Opening

## Question

{% embed url="<https://open.kattis.com/problems/bottleopening>" %}

## Solution

### Idea

**Time Complexity**: $$O(n)$$

This problem is also a give-away question. The key point is to convert it using **computational thinking**. The implementation is shown in the following [code](#code) part.

### Code

{% @github-files/github-code-block url="<https://github.com/mendax1234/Coding-Problems/blob/main/kattis/bottleopening/bottleopening.c>" %}
