Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, ...
分类:
其他好文 时间:
2020-03-05 13:49:20
阅读次数:
86
1 """ 2 Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? 3 Example: 4 Input: 3 5 Output: 5 6 Explanation: ...
分类:
其他好文 时间:
2020-03-04 23:30:47
阅读次数:
60
LeetCode 0079. Word Search单词搜索【Medium】【Python】【DFS】 Problem "LeetCode" Given a 2D board and a word, find if the word exists in the grid. The word can ...
分类:
编程语言 时间:
2020-03-04 23:00:46
阅读次数:
68
Find all pairs of elements in a given array that sum to the given target number. Return all the pairs of indices. Assumptions The given array is not n ...
分类:
其他好文 时间:
2020-03-04 09:14:57
阅读次数:
71
Problem Description Given a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same chara ...
分类:
其他好文 时间:
2020-03-04 00:28:32
阅读次数:
76
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.No... ...
分类:
其他好文 时间:
2020-03-03 14:34:22
阅读次数:
94
考虑到 $ans_{i+1} \leq ans_i$ 且 $ans_{i} \leq \frac{n}{i}$ 然后胡乱分析一波,考虑根号分治,一部分暴力,一部分按根号的性质来,考虑到块取成 $q$,一部分暴力的复杂度是 $nq$,然后你发现剩下的值域仅仅是 $[0,\frac{n}{q}]$,由于 ...
分类:
其他好文 时间:
2020-03-03 14:31:10
阅读次数:
74
不得不说cf题目都是毒瘤,一篇读下来我头都裂开了 (哭) 个人认为这次的大坑点是E题 不谈有生之年的F题 和平常一样A,B,C都是思维题不过这次C题有坑还是贴一下 C题: https://codeforces.ml/contest/1321/problem/C You are given a str ...
分类:
其他好文 时间:
2020-03-03 00:47:42
阅读次数:
79
Given a m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i] ...
分类:
其他好文 时间:
2020-03-02 10:51:12
阅读次数:
71
1、题目 Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's ...
分类:
其他好文 时间:
2020-03-02 01:09:35
阅读次数:
82