Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example 1: Example 2: Note:You may assume all input has v ...
分类:
其他好文 时间:
2019-11-01 09:40:11
阅读次数:
64
给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。 返回符合要求的最少分割次数。 示例: 输入:?"aab" 输出: 1 解释: 进行一次分割就可将?s 分割成 ["aa","b"] 这样两个回文子串。 class Solution { public: int ispalindrom ...
分类:
其他好文 时间:
2019-10-31 23:21:30
阅读次数:
111
Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [4,9] Exam ...
分类:
其他好文 时间:
2019-10-31 13:31:37
阅读次数:
103
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is ...
分类:
其他好文 时间:
2019-10-29 10:02:16
阅读次数:
97
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 trian ...
分类:
其他好文 时间:
2019-10-27 00:59:59
阅读次数:
105
package LeetCode_240 /** * 240. Search a 2D Matrix II * https://leetcode.com/problems/search-a-2d-matrix-ii/description/ * * Write an efficient algori... ...
分类:
其他好文 时间:
2019-10-27 00:56:21
阅读次数:
103
题目: https://www.acwing.com/problem/content/6/ 有 N 种物品和一个容量是 V 的背包。 第 ii 种物品最多有 si 件,每件体积是 vi,价值是 wi。 求解将哪些物品装入背包,可使物品体积总和不超过背包容量,且价值总和最大。输出最大价值。 输入格式 ...
分类:
其他好文 时间:
2019-10-25 20:24:51
阅读次数:
58
' 对XML文件按照文本文件的方式进行遍历 Private Sub checkFile_establishEntity(strFile As String) Dim reader AsTextReader = File.OpenText(strFile) ' 打开文件 Dim ii AsIntege ...
分类:
Web程序 时间:
2019-10-25 18:42:46
阅读次数:
133
题意: 在一个长度无限的数轴上,第 i 颗石子的位置为 stones[i]。如果一颗石子的位置最小/最大,那么该石子被称作端点石子。 每个回合,你可以将一颗端点石子拿起并移动到一个未占用的位置,使得该石子不再是一颗端点石子。 值得注意的是,如果石子像 stones = [1,2,5] 这样,你将无法 ...
分类:
移动开发 时间:
2019-10-24 23:41:54
阅读次数:
177
Difficulty:easy More:【目录】LeetCode Java实现 Description https://leetcode.com/problems/contains-duplicate-ii/ Given an array of integers and an integer k, ...
分类:
其他好文 时间:
2019-10-24 10:08:32
阅读次数:
65