Given a stream of transaction logs, write a function to detect anomalous patterns within a rolling time window.
Treat a transaction as anomalous when its inclusive rolling window contains at least two transactions, regardless of user. Return the zero-based indices of all anomalous transactions. Logs are ordered by nondecreasing timestamp.
The function accepts logs, a list of [timestamp, transaction_id] pairs, and window_seconds, a nonnegative integer. Return a list of indices.
def detect_anomalies(logs, window_seconds):