# solution with group by

• select * from stadium where id in (
select id from stadium where people >= 100 group by floor(id/3) having count(1) = 3 union select id from stadium where people >= 100 group by floor((id+1)/3) having count(1) = 3 union select id from stadium where people >= 100 group by floor((id+2)/3) having count(1) = 3
) or id - 1 in (
select id from stadium where people >= 100 group by floor(id/3) having count(1) = 3 union select id from stadium where people >= 100 group by floor((id+1)/3) having count(1) = 3 union select id from stadium where people >= 100 group by floor((id+2)/3) having count(1) = 3
) or id - 2 in (
select id from stadium where people >= 100 group by floor(id/3) having count(1) = 3 union select id from stadium where people >= 100 group by floor((id+1)/3) having count(1) = 3 union select id from stadium where people >= 100 group by floor((id+2)/3) having count(1) = 3
)

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.