牛客网
牛客题解
九久呀
一名计算机系学生的博客
展开
-
力扣--最长递增子序列的个数
Given an integer array nums, return the number of longest increasing subsequences. Notice that the sequence has to be strictly increasing. Example 1: Input: nums = [1,3,5,4,7] Output: 2 Explanation: The two longest increasing subsequences are [1, 3, 4, 7]原创 2021-07-04 21:28:30 · 119 阅读 · 0 评论 -
力扣--最长上升子序列
题目: Given an integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For examp原创 2021-06-22 21:39:54 · 132 阅读 · 0 评论 -
翻转链表
题目描述 输入一个链表,反转链表后,输出新链表的表头。 示例1 输入 {1,2,3} 返回值 {3,2,1} 思路 遍历链表,使用头插法建立新的链表,不过需要注意一点,题目中所给的链表没有头结点。 /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: List...原创 2021-03-21 10:48:08 · 81 阅读 · 0 评论
分享