刷题
Zachos
这个作者很懒,什么都没留下…
展开
-
Leetcode-MySQL(180. 连续出现的数字)
编写一个 SQL 查询,查找所有至少连续出现三次的数字。# Write your MySQL query statement belowSELECT distinct a1.Num as ConsecutiveNumsfrom Logs a1,logs b1, logs c1where a1.Id = b1.Id-1 and c1.Id = b1.Id+1 and a1.Num = b1.Num and b1.Num = c1.Num点击链接...原创 2020-10-09 22:40:10 · 89 阅读 · 0 评论 -
Leetcode-MySQL(183. 从不订购的客户)
从不订购的客户:某网站包含两个表,Customers 表和 Orders 表。编写一个 SQL 查询,找出所有从不订购任何东西的客户。# Write your MySQL query statement belowSELECT Customers.Name as CustomersFROM CustomersLEFT JOIN orders on Customers.Id <=> orders.CustomerIdWHERE orders.CustomerId IS NULL;.原创 2020-10-09 22:37:04 · 109 阅读 · 0 评论 -
Leetcode-MySQL(175. 组合两个表)
组合两个表# Write your MySQL query statement belowSELECT FirstName, LastName, City, StateFROM Person LEFT JOIN AddressON Person.PersonId = Address.PersonId原创 2020-10-09 22:35:51 · 66 阅读 · 0 评论 -
Leetcode-MySQL(596. 超过5名学生的课)
超过5名学生的课:有一个courses 表 ,有: student (学生) 和 class (课程)。请列出所有超过或等于5名学生的课。# Write your MySQL query statement belowSELECT classFROM coursesGROUP BY classHAVING count(distinct student) >= 5;...原创 2020-10-09 22:34:39 · 145 阅读 · 0 评论 -
Leetcode-MySQL(595. 大的国家)
大的国家# Write your MySQL query statement belowSELECT name, population, areaFROM WorldWHERE area > 3000000 or population > 25000000;原创 2020-10-09 22:32:55 · 105 阅读 · 0 评论 -
Leetcode_Day10
242.有效字母异位词:给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。解题思路:字母异位词就是各个字母的数目相同,而顺序不一致。判断两个字符串里的字母和其出现的次数,然后进行比较是否相等。这是一道微软的面试题,例如,“silent”和“listen”就是字母异位词。class Solution: def isAnagram(self, s: str, t: str) -> bool: return Counter(s) == Counter原创 2020-07-01 15:37:42 · 108 阅读 · 0 评论