摘要: 题目链接:https://leetcode-cn.com/problems/swap-nodes-in-pairs/ 题目描述: 给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。 回顾:链表反转 题解: /** * Defin 阅读全文
posted @ 2021-05-13 14:41 张宵 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock 题目描述: 给定一个数组 prices ,它的第 i 个元素 prices[i] 表示一支给定股票第 i 天的价格。 你只能选择 某一天 买入这只股票,并选择在 阅读全文
posted @ 2021-05-13 14:01 张宵 阅读(45) 评论(0) 推荐(0) 编辑