Devanshi Kapla

Results 4 issues of Devanshi Kapla

appending elements of the stack into another stack using a third stack.

changes-required

class Solution { public: bool findTarget(TreeNode* root, int k) { vectorans; stackst; TreeNode* Node=root; while(true){ if(Node!=NULL){ st.push(Node); Node=Node->left; } else{ if(st.empty()==true)break; Node=st.top(); st.pop(); ans.push_back(Node->val); Node=Node->right; } } int i=0; int...

class Solution { private: void dfs(int row, int col, vector&ans, vector& image, int newColor, int delRow[], int delCol[], int iniColor) { ans[row][col] = newColor; int n = image.size(); int m...

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int...