![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
lxyer4u
这个作者很懒,什么都没留下…
展开
-
LeetCode-1281. 整数的各位积和之差(Subtract the Product and Sum of Digits of an Integer)
1281. 整数的各位积和之差Difficulty: 简单更多LeetCode答案欢迎大家关注我的 Github给你一个整数 n,请你帮忙计算并返回该整数「各位数字之积」与「各位数字之和」的差。示例 1:输入:n = 234输出:15 解释:各位数之积 = 2 * 3 * 4 = 24 各位数之和 = 2 + 3 + 4 = 9 结果 = 24 - 9 = 15示例 2...原创 2019-12-20 18:21:30 · 3693 阅读 · 0 评论 -
LeetCode-771. 宝石与石头(Jewels and Stones)
771. 宝石与石头Difficulty: 简单更多LeetCode答案欢迎大家关注我的 Github给定字符串J 代表石头中宝石的类型,和字符串 S代表你拥有的石头。 S 中每个字符代表了一种你拥有的石头的类型,你想知道你拥有的石头中有多少是宝石。J 中的字母不重复,J 和 S中的所有字符都是字母。字母区分大小写,因此"a"和"A"是不同类型的石头。示例 1:输入: J = "a...原创 2019-12-20 17:51:36 · 163 阅读 · 0 评论 -
LeetCode-LCP 1. 猜数字
LCP 1. 猜数字Difficulty: 简单更多LeetCode答案欢迎大家关注我的 Github小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小A 猜对了几次?输入的guess数组为 小A 每次的猜测,answer数组为 小B 每次的选择。guess和answer的长度都等...原创 2019-12-19 17:23:54 · 107 阅读 · 0 评论 -
LeetCode-27. 移除元素(Remove Element)
27. 移除元素Difficulty: 简单给定一个数组 _nums _和一个值 val,你需要移除所有数值等于 _val _的元素,返回移除后数组的新长度。不要使用额外的数组空间,你必须在修改输入数组并在使用 O(1) 额外空间的条件下完成。元素的顺序可以改变。你不需要考虑数组中超出新长度后面的元素。示例 1:给定 nums = [3,2,2,3], val = 3,函数应该返回...原创 2019-12-19 16:55:21 · 124 阅读 · 0 评论 -
LeetCode-删除排序数组中的重复项(Remove Duplicates from Sorted Array)
26. Remove Duplicates from Sorted ArrayCopy for MarkdownCopy for MarkdownCopy for MarkdownCopy for MarkdownDifficulty: 简单给定一个排序数组,你需要在给定一个排序数组,你需要在删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。不要使用额外的数组空间,你必须...原创 2019-05-30 15:33:34 · 139 阅读 · 0 评论 -
LeetCode-合并两个有序链表(Merge Two Sorted Lists)
21. 合并两个有序链表Difficulty: 简单将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。示例:输入:1->2->4, 1->3->4输出:1->1->2->3->4->4SolutionLanguage: Java/** * Definition for singly-...原创 2019-05-27 17:20:50 · 171 阅读 · 0 评论 -
LeetCode-从不订购的客户(customers-who-never-order)
183. 从不订购的客户(Customers Who Never Order)题目难度: 简单更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswer某网站包含两个表,Customers 表和 Orders 表。编写一个 SQL 查询,找出所有从不订购任何东西的客户。Customers 表:+----+----...原创 2018-11-02 12:00:02 · 237 阅读 · 0 评论 -
LeetCode-查找重复的电子邮箱(duplicate-emails)
182. 查找重复的电子邮箱(Duplicate Emails)题目难度: 简单更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswer编写一个 SQL 查询,查找 Person 表中所有重复的电子邮箱。示例:+----+---------+| Id | Email |+----+------...原创 2018-11-01 14:43:45 · 495 阅读 · 0 评论 -
LeetCode-超过经理收入的员工(employees-earning-more-than-their-managers)
超过经理收入的员工难度 简单更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswerEmployee 表包含所有员工,他们的经理也属于员工。每个员工都有一个 Id,此外还有一列对应员工的经理的 Id。+----+-------+--------+-----------+| Id | Name | S...原创 2018-11-01 13:50:26 · 186 阅读 · 0 评论 -
LeetCode-第二高的薪水(second-highest-salary)
第二高的薪水难度 简单更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswer编写一个 SQL 查询,获取 Employee 表中第二高的薪水(Salary) 。+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 ...原创 2018-10-25 13:41:54 · 208 阅读 · 0 评论 -
LeetCode-Longest Common Prefix
14. Longest Common Prefix更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswerDifficulty: EasyWrite a function to find the longest common prefix string amongst an array of strings.If...原创 2018-09-20 12:25:09 · 157 阅读 · 0 评论 -
LeetCode-Palindrome Number
13. Roman to Integer更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswerDifficulty: EasyRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ...原创 2018-09-20 12:03:39 · 220 阅读 · 0 评论 -
LeetCode-Roman to Integer
7. Reverse Integer更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswerDifficulty: EasyGiven a 32-bit signed integer, reverse digits of an integer.Example 1:**Input:** 123**Output:...原创 2018-09-19 22:07:15 · 203 阅读 · 0 评论 -
LeetCode-Two Sum
1. Two Sum更多LeetCode答案欢迎大家关注Github: https://github.com/lxyer/LeetCodeAnswerDifficulty: EasyGiven an array of integers, return indices of the two numbers such that they add up to a specific target...原创 2018-09-19 21:20:08 · 135 阅读 · 0 评论