2023-10-18 19:16:23 -04:00
# Introduction
Your friend Eliud inherited a farm from her grandma Tigist.
Her granny was an inventor and had a tendency to build things in an overly complicated manner.
The chicken coop has a digital display showing an encoded number representing the positions of all eggs that could be picked up.
Eliud is asking you to write a program that shows the actual number of eggs in the coop.
The position information encoding is calculated as follows:
1. Scan the potential egg-laying spots and mark down a `1` for an existing egg or a `0` for an empty spot.
2. Convert the number from binary to decimal.
3. Show the result on the display.
2024-12-06 04:18:51 -08:00
## Example 1

2023-10-18 19:16:23 -04:00
```text
_ _ _ _ _ _ _
|E| |E|E| | |E|
2024-12-06 04:18:51 -08:00
```
### Resulting Binary

```text
_ _ _ _ _ _ _
|1|0|1|1|0|0|1|
```
2023-10-18 19:16:23 -04:00
2024-12-06 04:18:51 -08:00
### Decimal number on the display
2023-10-18 19:16:23 -04:00
89
2024-12-06 04:18:51 -08:00
### Actual eggs in the coop
2023-10-18 19:16:23 -04:00
4
2024-12-06 04:18:51 -08:00
## Example 2

```text
_ _ _ _ _ _ _
| | | |E| | | |
2023-10-18 19:16:23 -04:00
```
2024-12-06 04:18:51 -08:00
### Resulting Binary

2023-10-18 19:16:23 -04:00
```text
2024-12-06 04:18:51 -08:00
_ _ _ _ _ _ _
|0|0|0|1|0|0|0|
```
2023-10-18 19:16:23 -04:00
2024-12-06 04:18:51 -08:00
### Decimal number on the display
2023-10-18 19:16:23 -04:00
2025-07-15 07:50:26 -04:00
8
2023-10-18 19:16:23 -04:00
2024-12-06 04:18:51 -08:00
### Actual eggs in the coop
2023-10-18 19:16:23 -04:00
1