Skip to content

Commit 04125ad

Browse files
authored
Create leetflex-banned-accounts.sql
1 parent d6c85a6 commit 04125ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MySQL/leetflex-banned-accounts.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Time: O(n^2)
2+
# Space: O(n)
3+
4+
SELECT DISTINCT l1.account_id
5+
FROM loginfo l1
6+
INNER JOIN loginfo l2
7+
ON l1.account_id = l2.account_id
8+
AND l1.ip_address != l2.ip_address
9+
WHERE NOT (l1.login > l2.logout
10+
OR l1.logout < l2.login);

0 commit comments

Comments
 (0)