摘要: 地址:https://leetcode-cn.com/problems/rank-scores/ ## 编写一个 SQL 查询来实现分数排名。 。 示例: 如果两个分数相同,则两个分数排名(Rank)相同。请注意,平分后的下一个名次应该是下一个连续的整数值。换句话说,名次之间不应该有“间隔”。 + 阅读全文
posted @ 2020-04-17 15:34 花花妹子。 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/first-unique-character-in-a-string/ <?php /** 给定一个字符串,找到它的第一个不重复的字符,并返回它的索引。如果不存在,则返回 -1。 案例: s = "leetcode" 返回 0. 阅读全文
posted @ 2020-04-17 14:28 花花妹子。 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/guess-number-higher-or-lower/ <?php /** * 我们正在玩一个猜数字游戏。 游戏规则如下: * 我从 1 到 n 选择一个数字。 你需要猜我选择了哪个数字。 * 每次你猜错了,我会告诉你这个数 阅读全文
posted @ 2020-04-17 11:19 花花妹子。 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/sum-of-two-integers/ <?php /** 不使用运算符 + 和 - ​​​​​​​,计算两整数 ​​​​​​​a 、b ​​​​​​​之和。 示例 1: 输入: a = 1, b = 2 输出: 3 示例 2 阅读全文
posted @ 2020-04-17 11:00 花花妹子。 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/intersection-of-two-arrays-ii/ <?php /** 给定两个数组,编写一个函数来计算它们的交集。 示例 1: 输入: nums1 = [1,2,2,1], nums2 = [2,2] 输出: [2, 阅读全文
posted @ 2020-04-17 10:33 花花妹子。 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/power-of-three/ <?php /** 给定一个整数,写一个函数来判断它是否是 3 的幂次方。 示例 1: 输入: 27 输出: true 示例 2: 输入: 0 输出: false 示例 3: 输入: 9 输出: 阅读全文
posted @ 2020-04-17 09:51 花花妹子。 阅读(139) 评论(0) 推荐(0) 编辑