上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 33 下一页
摘要: 地址:https://leetcode-cn.com/problems/jewels-and-stones/ <?php /** 给定字符串J 代表石头中宝石的类型,和字符串 S代表你拥有的石头。 S 中每个字符代表了一种你拥有的石头的类型,你想知道你拥有的石头中有多少是宝石。 J 中的字母不重复, 阅读全文
posted @ 2020-03-29 23:07 花花妹子。 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/decompress-run-length-encoded-list/ <?php /** 给你一个以行程长度编码压缩的整数列表 nums 。 考虑每对相邻的两个元素 freq, val] = [nums[2*i], nums[ 阅读全文
posted @ 2020-03-28 20:02 花花妹子。 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/create-target-array-in-the-given-order/ <?php /** 给你两个整数数组 nums 和 index。你需要按照以下规则创建目标数组: 目标数组 target 最初为空。 按从左到右的顺 阅读全文
posted @ 2020-03-28 19:48 花花妹子。 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/find-numbers-with-even-number-of-digits/ <?php /** 给你一个整数数组 nums,请你返回其中位数为 偶数 的数字的个数。 示例 1: 输入:nums = [12,345,2,6, 阅读全文
posted @ 2020-03-28 13:10 花花妹子。 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/qiu-12n-lcof/ <?php /** 求 1+2+...+n ,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 示例 1: 输入: n = 3 输出 阅读全文
posted @ 2020-03-28 10:08 花花妹子。 阅读(106) 评论(0) 推荐(0) 编辑
摘要: d地址:https://leetcode-cn.com/problems/x-of-a-kind-in-a-deck-of-cards/ <?php /** 给定一副牌,每张牌上都写着一个整数。 此时,你需要选定一个数字 X,使我们可以将整副牌按下述规则分成 1 组或更多组: 每组都有 X 张牌。 阅读全文
posted @ 2020-03-28 09:52 花花妹子。 阅读(140) 评论(0) 推荐(0) 编辑
摘要: di地址:https://leetcode-cn.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/ <?php /** 给你一个整数 n,请你帮忙计算并返回该整数「各位数字之积」与「各位数字之和」的差。 示例 1: 阅读全文
posted @ 2020-03-27 11:58 花花妹子。 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/guess-numbers/ <?php /** 小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小A 猜对了几次? 输入 阅读全文
posted @ 2020-03-27 11:44 花花妹子。 阅读(168) 评论(0) 推荐(0) 编辑
摘要: d地址:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/ <?php /** 给定一个排序数组,你需要在 原地 删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。 不要使用额外的数组空间,你必 阅读全文
posted @ 2020-03-27 11:13 花花妹子。 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/intersection-of-two-arrays/ <?php /** 给定两个数组,编写一个函数来计算它们的交集。 示例 1: 输入: nums1 = [1,2,2,1], nums2 = [2,2] 输出: [2] 示例 阅读全文
posted @ 2020-03-27 10:19 花花妹子。 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 33 下一页