摘要: 地址:https://leetcode-cn.com/problems/sort-array-by-parity/ <?php /** 给定一个非负整数数组 A,返回一个数组,在该数组中, A 的所有偶数元素之后跟着所有奇数元素。 你可以返回满足此条件的任何数组作为答案。 示例: 输入:[3,1,2 阅读全文
posted @ 2020-09-27 14:38 花花妹子。 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/array-partition-i/ <?php /** 给定长度为 2n 的数组, 你的任务是将这些数分成 n 对, 例如 (a1, b1), (a2, b2), ..., (an, bn) ,使得从1 到 n 的 min(a 阅读全文
posted @ 2020-09-27 14:04 花花妹子。 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/is-unique-lcci/ <?php /** 实现一个算法,确定一个字符串 s 的所有字符是否全都不同。 示例 1: 输入: s = "leetcode" 输出: false 示例 2: 输入: s = "abc" 输出: 阅读全文
posted @ 2020-09-27 13:54 花花妹子。 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/unique-number-of-occurrences/ <?php /** 给你一个整数数组 arr,请你帮忙统计数组中每个数的出现次数。 如果每个数的出现次数都是独一无二的,就返回 true;否则返回 false。 示例 阅读全文
posted @ 2020-09-27 13:45 花花妹子。 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/find-words-that-can-be-formed-by-characters/ <?php /** 给你一份『词汇表』(字符串数组) words 和一张『字母表』(字符串) chars。 假如你可以用 chars 中的 阅读全文
posted @ 2020-09-27 11:25 花花妹子。 阅读(99) 评论(0) 推荐(0) 编辑