摘要: 问题: 求给定数组中两两元素之差,从小到大第k个差是多少 Example 1: Input: nums = [1,3,1] k = 1 Output: 0 Explanation: Here are all the pairs: (1,3) -> 2 (1,1) -> 0 (3,1) -> 2 Th 阅读全文
posted @ 2020-05-04 14:31 habibah_chang 阅读(116) 评论(0) 推荐(0)
摘要: 问题: 给定两个数组,求两个数组中最长公共子数组的长度。 Example 1: Input: A: [1,2,3,2,1] B: [3,2,1,4,7] Output: 3 Explanation: The repeated subarray with maximum length is [3, 2 阅读全文
posted @ 2020-05-04 12:43 habibah_chang 阅读(179) 评论(0) 推荐(0)
摘要: 问题: 解码问题,给出一串0,1数列, 遇到1,则由10或11解码为一个字符。 否则遇到0,则单独0解码为一个字符。求解码到最后一个字符是否由0解码而来。 (给出数列,总是以0为结尾) Example 1: Input: bits = [1, 0, 0] Output: True Explanati 阅读全文
posted @ 2020-05-04 11:30 habibah_chang 阅读(127) 评论(0) 推荐(0)