上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 28 下一页
摘要: Source Using O(1) time to check whether an integer n is a power of 2. Example For n=4, return true; For n=5, return false; Challenge O(1) time 题解 咋看起来 阅读全文
posted @ 2021-01-10 16:08 凌雨尘 阅读(99) 评论(0) 推荐(0)
摘要: 一、区别 1、传输协议 RPC,可以基于TCP协议,也可以基于HTTP协议 HTTP,基于HTTP协议 2、传输效率 RPC,使用自定义的TCP协议,可以让请求报⽂体积更小,或者使用HTTP2协议,也可以很好的减少报文的体积,提高传输效率 HTTP,如果是基于HTTP1.1的协议,请求中会包含很多无 阅读全文
posted @ 2020-12-18 10:14 凌雨尘 阅读(224) 评论(0) 推荐(0)
摘要: DER格式的密钥转PEM PEM格式的密钥就是用DER格式的数据用base64进行编码后,然后在前后加上 “ BEGIN PUBLIC KEY ” 和 “ END PUBLIC KEY ” PHP 十进制DER数据转换 $derData = 'XXXXXXXXXXXXXXXXXXXX'; $pemD 阅读全文
posted @ 2020-12-15 10:43 凌雨尘 阅读(741) 评论(0) 推荐(0)
摘要: 背景 最近在对接建行的支付,我们做的是被扫支付,就是B扫C,一开始对方发了一个压缩包给我,看起来挺齐全的,文档、demo啥的都有,以为很简单,跟微信支付宝类似,调一下接口,验证一下就OK了。然而,事实证明我还是太年轻了。而且网络上你能够搜到的基本上都用不了,所以记一下博客,或许可以帮助其他人。 先说 阅读全文
posted @ 2020-12-11 18:07 凌雨尘 阅读(2691) 评论(21) 推荐(0)
摘要: Source Given 2*n + 2 numbers, every numbers occurs twice except two, find them. Example Given [1,2,2,3,4,4,5,3] return 1 and 5 Challenge O(n) time, O( 阅读全文
posted @ 2020-11-08 13:33 凌雨尘 阅读(103) 评论(0) 推荐(0)
摘要: Source Given 3*n + 1 numbers, every numbers occurs triple times except one, find it. Example Given [1,1,2,3,3,3,2,2,4,1] return 4 Challenge One-pass, 阅读全文
posted @ 2020-10-25 12:39 凌雨尘 阅读(119) 评论(0) 推荐(0)
摘要: Problem 「找单数」系列题,技巧性较强,需要灵活运用位运算的特性。 Given 2*n + 1 numbers, every numbers occurs twice except one, find it. Example Given [1,2,2,1,3,4,3], return 4 Ch 阅读全文
posted @ 2020-10-11 12:27 凌雨尘 阅读(149) 评论(0) 推荐(0)
摘要: Problem Given n pieces of wood with length L[i] (integer array). Cut them into smallpieces to guarantee you could have equal or more than k pieces wit 阅读全文
posted @ 2020-09-20 12:27 凌雨尘 阅读(291) 评论(0) 推荐(0)
摘要: 实现 int sqrt(int x) 函数 计算并返回 x 的平方根,其中 x 是非负整数。 由于返回类型是整数,结果只保留整数的部分,小数部分将被舍去。 示例 1: 输入: 4 输出: 2 示例 2: 输入: 8 输出: 2 说明: 8 的平方根是 2.82842..., 由于返回类型是整数,小数 阅读全文
posted @ 2020-09-06 12:38 凌雨尘 阅读(358) 评论(0) 推荐(0)
摘要: Problem There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. Example Given A=[1,2,3,4,5,6] and  阅读全文
posted @ 2020-08-16 12:33 凌雨尘 阅读(177) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 28 下一页