原题链接在这里:https://leetcode.com/problems/building-h2o/ 题目: There are two kinds of threads, oxygen and hydrogen. Your goal is to group these threads to fo ...
分类:
其他好文 时间:
2020-02-13 10:02:55
阅读次数:
76
爬楼梯。题意是给一个数字n代表楼梯的高度,你可以每次爬一步或者两步,求有多少种不同的爬法。例子, Example 1: Input: 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step ...
分类:
其他好文 时间:
2020-02-13 09:56:32
阅读次数:
70
一、Kubernetes无状态服务VS有状态服务1)Kubernetes无状态服务Kubernetes无状态服务特征:1)是指该服务运行的实例不会在本地存储需要持久化的数据,并且多个实例对于同一请求响应的结果是完全一致的;2)多个实例可以共享相同的持久化数据。例如:nginx实例、tomcat实例等;3)相关的Kubernetes资源有:ReplicaSet、ReplicationControll
分类:
Web程序 时间:
2020-02-13 09:44:33
阅读次数:
70
Given an array of integers arr and two integers k and threshold. Return the number of sub-arrays of size k and average greater than or equal to thresh ...
分类:
其他好文 时间:
2020-02-13 09:42:29
阅读次数:
54
Given two numbers, hour and minutes. Return the smaller angle (in sexagesimal units) formed between the hour and the minute hand. Example 1: Input: ho ...
分类:
其他好文 时间:
2020-02-13 09:30:42
阅读次数:
57
LeetCode 0088. Merge Sorted Array合并两个有序数组【Easy】【Python】【双指针】 题目 "英文题目链接" Given two sorted integer arrays nums1 and nums2 , merge nums2 into nums1 as o ...
分类:
编程语言 时间:
2020-02-12 23:50:19
阅读次数:
89
codeforces 1272 F. Two Bracket Sequences(三维dp + bfs) 题目大意 输入两个括号序列 s,t(不一定合法),你需要构造一个尽可能短的合法括号序列使得s,t 都是这个序列的子序列(子序列意味着不用连续) 解题思路 表示匹配到 的第 个字符,匹配到 的第 ...
分类:
其他好文 时间:
2020-02-12 21:57:14
阅读次数:
63
大致题意就是给定N个数,找出满足第i个数到第j个数的和SUM等于M(如果找不到,也可以找SUM-M>0差值最小)的i和j,并输出i-j。 思路:这题可以用二分法做,但是二分法边界值条件太多,容易出错,推荐使用two pointers。这题用的是two pointers同向扫描法,固定左边界,移动右边 ...
分类:
其他好文 时间:
2020-02-12 13:06:56
阅读次数:
61
这道题要求两个有序数组,找出中间位置的平均值; 解题思路: 1、取A数组的中间位置mid的值key,去B数组中查找最靠近key且小于等于key的位置index; 2、将原数组切成三段,index和mid之前数组的为新的left数组;right1跟right2为新的right数组;mid到right1 ...
分类:
其他好文 时间:
2020-02-12 12:51:16
阅读次数:
52
更多LeetCode解题详解 Easy Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M). More ...
分类:
其他好文 时间:
2020-02-12 00:59:17
阅读次数:
85