# NIGHT AT THE DUCKSEUM

WEEKLY QUACK CHALLENGE! · challenge 8 · hard · 5 guesses

> Curator Canvasback fans through the overnight badge log, beak trembling. "Five guards walked these halls last night, Duckbert — but one of them showed up at two doors so far apart that no duck could have waddled between them in time. Someone's badge got cloned. Or worse. Find the guard whose consecutive swipes defy the laws of physics — and duck anatomy."

## Task

Catch the imposter. For each guard, scan their badge swipes in time order: a consecutive pair is impossible when less time passed between the two swipes than the minutes needed to walk between those doors (`door_distances` gives the walk for both directions). Return the name of the one guard with an impossible pair. You will be working with the `badge_swipes` and `door_distances` tables.

## Tables

### `badge_swipes` (19 rows)

| column | type |
| --- | --- |
| guard_id | INTEGER |
| guard_name | VARCHAR |
| door_id | INTEGER |
| ts | TIMESTAMP |

### `door_distances` (30 rows)

| column | type |
| --- | --- |
| door_a | INTEGER |
| door_b | INTEGER |
| walk_minutes | INTEGER |

## Data

The tables live in a DuckDB database: https://dbquacks.com/data/databases/weekly_202634_08_duckseum.duckdb

To query it outside the browser, attach it read-only:

```sql
ATTACH 'https://dbquacks.com/data/databases/weekly_202634_08_duckseum.duckdb' AS db (READ_ONLY);
USE db;
```

Play it in the browser: https://dbquacks.com/challenges/weekly/8

## Answer

The expected answer is not published. Submit on the page to have it checked.
