Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha ...
分类:
其他好文 时间:
2020-07-28 14:04:15
阅读次数:
77
题目描述 Roundgod is given n,k,construct a permutation P of 1~n satisfying that for all integers i in [1,n],there exists a contiguous subarray in P of len ...
分类:
其他好文 时间:
2020-07-28 00:18:40
阅读次数:
75
Given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the s ...
分类:
其他好文 时间:
2020-07-27 15:58:17
阅读次数:
93
Given an array of positive integers target and an array initial of same size with all zeros. Return the minimum number of operations to form a target ...
分类:
其他好文 时间:
2020-07-27 15:38:31
阅读次数:
66
题目来源: http://codeforces.com/problemset/problem/122/A Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal ...
分类:
其他好文 时间:
2020-07-27 13:40:27
阅读次数:
64
题意 给你两个长度为 \(n\) 的串 \(a,b\) 求 \(a,b\) 两序列各任取一数相加形成的$n^2$个和的异或和 $1 \le n \le 2 \times 10^5$ $0 \le a_i \le 2^{28}$ 传送门 思路 按位考虑。对于第$i$位,令 \(x=2^i\),所有数对 ...
分类:
其他好文 时间:
2020-07-26 22:51:31
阅读次数:
66
Given an array of integers A with even length, return true if and only if it is possible to reorder it such that A[2 * i + 1] = 2 * A[2 * i] for every ...
分类:
编程语言 时间:
2020-07-26 19:14:18
阅读次数:
72
题目链接 https://leetcode-cn.com/problems/merge-two-binary-trees/ 题解 递归解法 解法见代码注释 // Problem: LeetCode 617 // URL: https://leetcode-cn.com/problems/merge- ...
分类:
其他好文 时间:
2020-07-26 01:03:49
阅读次数:
54
##题面 he length of the longest common prefix of two strings s=s1s2…sn and t=t1t2…tm is defined as the maximum integer k (0≤k≤min(n,m)) such that s1s2…s ...
分类:
其他好文 时间:
2020-07-26 00:15:56
阅读次数:
106
Given an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justif ...
分类:
其他好文 时间:
2020-07-25 09:35:28
阅读次数:
71