上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 33 下一页
摘要: 地址:https://leetcode-cn.com/problems/number-of-1-bits/ <?php /** 编写一个函数,输入是一个无符号整数,返回其二进制表达式中数字位数为 ‘1’ 的个数(也被称为汉明重量)。 示例 1: 输入:000000000000000000000000 阅读全文
posted @ 2020-06-04 17:08 花花妹子。 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/reverse-bits/ <?php /** 颠倒给定的 32 位无符号整数的二进制位。 示例 1: 输入: 00000010100101000001111010011100 输出: 001110010111100000101 阅读全文
posted @ 2020-06-04 16:32 花花妹子。 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/median-of-two-sorted-arrays/ <?php /** 给定两个大小为 m 和 n 的正序(从小到大)数组 nums1 和 nums2。 请你找出这两个正序数组的中位数,并且要求算法的时间复杂度为 O(lo 阅读全文
posted @ 2020-06-04 15:32 花花妹子。 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/longest-palindromic-substring/ <?php /** 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。 示例 1: 输入: "babad" 输出: "bab" 阅读全文
posted @ 2020-06-04 10:26 花花妹子。 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/valid-anagram/ <?php /** * 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 * * 示例 1: * * 输入: s = "anagram", t = "nagaram" 阅读全文
posted @ 2020-06-03 20:58 花花妹子。 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/implement-stack-using-queues/ <?php /** 使用队列实现栈的下列操作: push(x) -- 元素 x 入栈 pop() -- 移除栈顶元素 top() -- 获取栈顶元素 empty() - 阅读全文
posted @ 2020-06-03 16:27 花花妹子。 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/add-strings/ <?php /** 给定两个字符串形式的非负整数 num1 和num2 ,计算它们的和。 注意: num1 和num2 的长度都小于 5100. num1 和num2 都只包含数字 0-9. num1 阅读全文
posted @ 2020-06-03 16:09 花花妹子。 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 使用MQ的三大作用:1、同步变异步2、流量削峰3、解耦降低服务间的耦合性要不要使用MQ,需不需要使用MQ依据项目的需要做选择。 使用场景: 例如:注册用户时候,发送激活邮件。监控应用中抛出的异常,邮件通知管理员。也就是增加监控功能,且一个消息服务可以监控无数个应用。异构型架构系统间的各服务通信,因为 阅读全文
posted @ 2020-06-01 11:04 花花妹子。 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ <?php /** 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb" 输出 阅读全文
posted @ 2020-05-28 23:30 花花妹子。 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/ <?php /** 请定义一个队列并实现函数 max_value 得到队列里的最大值,要求函数max_value、push_back 和 pop_front 的均摊时间复杂 阅读全文
posted @ 2020-05-28 21:38 花花妹子。 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 33 下一页