传送门:牛客
题目描述:
A tree structure with some colors associated with its vertices and a sequence of commands on it are
given. A command is either an update operation or a query on the tree. Each of the update operations
changes the color of a specifi…
题目描述 原题链接:64. 最小路径和
解题思路
(1)回溯法
分别向右或下进行探查
class Solution {
public:int res INT_MAX;void backtracking(vector<vector<int>>& grid, int x, int y, int pathSum) {// 超出边界&…