Leetcode 122. 买卖股票的最佳时机 II
题目链接 122 买卖股票的最佳时机 II
本题目设计的还是比较巧妙的,把最终的利润分为每天的利润就解决了(贪心),每天的利润就是前一天买进,后一天卖出,转化到代码上就…
【题目来源】https://www.acwing.com/problem/content/190/
【题目描述】 农民 John 有很多牛,他想交易其中一头被 Don 称为 The Knight 的牛。 这头牛有一个独一无二的超能力,在农场里像 Knight 一样地跳(就是我们熟悉的象棋中马的走法&…
文章目录 一、题目二、题解 一、题目
Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.
Example 1:
Input: nums [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] Example …