Rest API - Rate Limiting and Throttling
Identify the error in the following sliding window code:
data = [1, 2, 3, 4]
window_size = 3
result = []
for i in range(len(data) - window_size):
window_sum = sum(data[i:i+window_size])
result.append(window_sum)
print(result)