<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Prashant Varma's team blog]]></title><description><![CDATA[Prashant Varma's team blog]]></description><link>https://dsaquestion.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 17 Oct 2026 12:00:05 GMT</lastBuildDate><atom:link href="https://dsaquestion.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Unlocking the code: Mastering Complex DS & Algo with Ease - Day 2]]></title><description><![CDATA[Hello Everyone🙋‍♂️ this is the Second blog of our Unlocking the Code: Mastering Complex DS & Algo with Ease series🔥🔥.
Second Problem:-
Pascal's Triangle: Try It
Now, Understand the Problem First Basically we have given an Integer (numRows) and We ...]]></description><link>https://dsaquestion.hashnode.dev/unlocking-the-code-mastering-complex-ds-algo-with-ease-day-2</link><guid isPermaLink="true">https://dsaquestion.hashnode.dev/unlocking-the-code-mastering-complex-ds-algo-with-ease-day-2</guid><category><![CDATA[Pascal's Triangle]]></category><category><![CDATA[DSA]]></category><dc:creator><![CDATA[Prashant Varma]]></dc:creator><pubDate>Wed, 07 Jun 2023 07:29:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/UgA3Xvi3SkA/upload/0e6b2439771b877dbe3f2cf17675436b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello Everyone🙋‍♂️ this is the Second blog of our <strong>Unlocking the Code: Mastering Complex DS &amp; Algo with Ease</strong> series🔥🔥.</p>
<h3 id="heading-second-problem"><strong>Second Problem:-</strong></h3>
<p><strong><mark>Pascal's Triangle:</mark></strong> <a target="_blank" href="https://leetcode.com/problems/pascals-triangle/">Try It</a></p>
<p>Now, Understand the Problem First Basically we have given an Integer (numRows) and We have to return Pascal's Triangle Whose number of rows is equal to numRows.</p>
<h3 id="heading-what-is-pascals-triangle"><strong>What is Pascal's Triangle?</strong></h3>
<p>Now a question comes to your mind what is Pascal's Triangle?</p>
<p><strong>In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:</strong></p>
<p><img src="https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif" alt class="image--center mx-auto" /></p>
<p><mark>Note:</mark> <a target="_blank" href="http://en.wikipedia.org/wiki/Pascal's_triangle">Pascal's triangle</a> is a triangular array of binomial coefficients.</p>
<pre><code class="lang-cpp"><span class="hljs-number">1</span>  
<span class="hljs-number">1</span> <span class="hljs-number">1</span> 
<span class="hljs-number">1</span> <span class="hljs-number">2</span> <span class="hljs-number">1</span> 
<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">3</span> <span class="hljs-number">1</span> 
<span class="hljs-number">1</span> <span class="hljs-number">4</span> <span class="hljs-number">6</span> <span class="hljs-number">4</span> <span class="hljs-number">1</span> 
<span class="hljs-number">1</span> <span class="hljs-number">5</span> <span class="hljs-number">10</span> <span class="hljs-number">10</span> <span class="hljs-number">5</span> <span class="hljs-number">1</span>
</code></pre>
<h3 id="heading-firstbrute-force-approach"><strong><mark>First(Brute-Force) Approach:</mark></strong></h3>
<p>The number of entries in every line is equal to the line number. For example, the first line has "1", the second line has "1 1", the third line has "1 2 1",.. and so on. Every entry in a line is the value of a <a target="_blank" href="http://en.wikipedia.org/wiki/Binomial_coefficient">Binomial Coefficient</a>. The value of <strong><em>the i</em></strong>th entry in line number <em>line</em> is <em>C(line, i)</em>. The value can be calculated using the following formula. </p>
<pre><code class="lang-cpp">C(line, i)   = line! / ( (line-i)! * i! )
</code></pre>
<p><strong>Time-Complexity: O(N^3)</strong></p>
<p><strong>Space-Complexity: O(1)</strong></p>
<p><strong><mark>Code:</mark></strong></p>
<pre><code class="lang-cpp"><span class="hljs-comment">//  C++ code for Pascal's Triangle</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;iostream&gt;</span></span>
<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;

<span class="hljs-comment">// for details of this function</span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">binomialCoeff</span><span class="hljs-params">(<span class="hljs-keyword">int</span> n, <span class="hljs-keyword">int</span> k)</span></span>;

<span class="hljs-comment">// Function to print first</span>
<span class="hljs-comment">// n lines of Pascal's </span>
<span class="hljs-comment">// Triangle</span>
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">printPascal</span><span class="hljs-params">(<span class="hljs-keyword">int</span> n)</span>
</span>{
    <span class="hljs-comment">// Iterate through every line and</span>
    <span class="hljs-comment">// print entries in it</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> line = <span class="hljs-number">0</span>; line &lt; n; line++)
    {
        <span class="hljs-comment">// Every line has number of </span>
        <span class="hljs-comment">// integers equal to line </span>
        <span class="hljs-comment">// number</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt;= line; i++)
            <span class="hljs-built_in">cout</span> &lt;&lt;<span class="hljs-string">" "</span>&lt;&lt; binomialCoeff(line, i);
        <span class="hljs-built_in">cout</span> &lt;&lt;<span class="hljs-string">"\n"</span>;
    }
}


<span class="hljs-comment">// for details of this function</span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">binomialCoeff</span><span class="hljs-params">(<span class="hljs-keyword">int</span> n, <span class="hljs-keyword">int</span> k)</span>
</span>{
    <span class="hljs-keyword">int</span> res = <span class="hljs-number">1</span>;
    <span class="hljs-keyword">if</span> (k &gt; n - k)
    k = n - k;
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; k; ++i)
    {
        res *= (n - i);
        res /= (i + <span class="hljs-number">1</span>);
    }

    <span class="hljs-keyword">return</span> res;
}

<span class="hljs-comment">// Driver program </span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> n = <span class="hljs-number">7</span>;
    printPascal(n);
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<h3 id="heading-second-approach"><strong><mark>Second Approach:</mark></strong></h3>
<p>If we take a closer at the triangle, we observe that every entry is the sum of the two values above it. So we can create a 2D array that stores previously generated values. To generate a value in a line, we can use the previously stored values from an array. </p>
<p><img src="https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif" alt class="image--center mx-auto" /></p>
<p><strong>Time-Complexity: O(N^2).</strong></p>
<p><strong>Space-Complexity: O(n^2).</strong></p>
<p><strong><mark>Code:</mark></strong></p>
<pre><code class="lang-cpp"><span class="hljs-comment">// C++ program for Pascal’s Triangle</span>
<span class="hljs-comment">// method for Pascal's Triangle</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;bits/stdc++.h&gt;</span></span>
<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;

<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">printPascal</span><span class="hljs-params">(<span class="hljs-keyword">int</span> n)</span>
</span>{

    <span class="hljs-comment">// An auxiliary array to store </span>
    <span class="hljs-comment">// generated pascal triangle values</span>
    <span class="hljs-keyword">int</span> arr[n][n]; 

    <span class="hljs-comment">// Iterate through every line and </span>
    <span class="hljs-comment">// print integer(s) in it</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> line = <span class="hljs-number">0</span>; line &lt; n; line++)
    {
        <span class="hljs-comment">// Every line has number of integers </span>
        <span class="hljs-comment">// equal to line number</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt;= line; i++)
        {
        <span class="hljs-comment">// First and last values in every row are 1</span>
        <span class="hljs-keyword">if</span> (line == i || i == <span class="hljs-number">0</span>)
            arr[line][i] = <span class="hljs-number">1</span>;
        <span class="hljs-comment">// Other values are sum of values just </span>
        <span class="hljs-comment">// above and left of above</span>
        <span class="hljs-keyword">else</span>
            arr[line][i] = arr[line - <span class="hljs-number">1</span>][i - <span class="hljs-number">1</span>] + 
                            arr[line - <span class="hljs-number">1</span>][i];
        <span class="hljs-built_in">cout</span> &lt;&lt; arr[line][i] &lt;&lt; <span class="hljs-string">" "</span>;
        }
        <span class="hljs-built_in">cout</span> &lt;&lt; <span class="hljs-string">"\n"</span>;
    }
}

<span class="hljs-comment">// Driver code</span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> n = <span class="hljs-number">5</span>;
    printPascal(n);
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<h3 id="heading-third-approach"><mark>Third Approach:</mark></h3>
<p>This method is based on method 1. We know that <strong><em>i</em></strong>th entry in a line number <em>line</em> is Binomial Coefficient <em>C(line, i)</em> and all lines start with value 1. The idea is to calculate <em>C(line, i)</em> using <em>C(line, i-1)</em>. It can be calculated in O(1) time using the following.   </p>
<pre><code class="lang-cpp">C(line, i)   = line! / ( (line-i)! * i! )
C(line, i<span class="hljs-number">-1</span>) = line! / ( (line - i + <span class="hljs-number">1</span>)! * (i<span class="hljs-number">-1</span>)! )
We can derive following expression from above two expressions.
C(line, i) = C(line, i<span class="hljs-number">-1</span>) * (line - i + <span class="hljs-number">1</span>) / i

So C(line, i) can be calculated from C(line, i<span class="hljs-number">-1</span>) in O(<span class="hljs-number">1</span>) time
</code></pre>
<p><strong>Time-Complexity: O(N^2).</strong></p>
<p><strong>Space-Complexity: O(1).</strong></p>
<p><strong><mark>Code:</mark></strong></p>
<pre><code class="lang-cpp">
<span class="hljs-comment">// C++ program for Pascal’s Triangle</span>
<span class="hljs-comment">// function for Pascal's Triangle</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;bits/stdc++.h&gt;</span></span>

<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">printPascal</span><span class="hljs-params">(<span class="hljs-keyword">int</span> n)</span>
</span>{

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> line = <span class="hljs-number">1</span>; line &lt;= n; line++)
{
    <span class="hljs-keyword">int</span> C = <span class="hljs-number">1</span>; <span class="hljs-comment">// used to represent C(line, i)</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">1</span>; i &lt;= line; i++) 
    {

        <span class="hljs-comment">// The first value in a line is always 1</span>
        <span class="hljs-built_in">cout</span>&lt;&lt; C&lt;&lt;<span class="hljs-string">" "</span>; 
        C = C * (line - i) / i; 
    }
    <span class="hljs-built_in">cout</span>&lt;&lt;<span class="hljs-string">"\n"</span>;
}
}

<span class="hljs-comment">// Driver code</span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> n = <span class="hljs-number">5</span>;
    printPascal(n);
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<p>Thank You so much everyone for reading this blog I hope it will be helpful for you in that case do like it and follow me on my socials:</p>
<p><a target="_blank" href="https://twitter.com/PrashantSony6"><strong>My Twitter</strong></a></p>
<p><a target="_blank" href="https://www.linkedin.com/in/prashant-varma-666735230/"><strong>My LinkedIn</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Unlocking the code: Mastering Complex DS & Algo with Ease - Day 1]]></title><description><![CDATA[Hello Everyone🙋‍♂️ this is the first blog of our Unlocking the Code: Mastering Complex DS & Algo with Ease series🔥🔥.
First of all Why this Series?
You must have seen many Folks, said on their socials that he/she has solved 500 Problems, 1000 Probl...]]></description><link>https://dsaquestion.hashnode.dev/unlocking-the-code-mastering-complex-ds-algo-with-ease-day-1</link><guid isPermaLink="true">https://dsaquestion.hashnode.dev/unlocking-the-code-mastering-complex-ds-algo-with-ease-day-1</guid><category><![CDATA[DSA]]></category><category><![CDATA[Set matrix zero]]></category><dc:creator><![CDATA[Prashant Varma]]></dc:creator><pubDate>Sun, 04 Jun 2023 19:38:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/UgA3Xvi3SkA/upload/a25168eb89ca52b7dfe2cad34c860c2e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello Everyone🙋‍♂️ this is the first blog of our <strong>Unlocking the Code: Mastering Complex DS &amp; Algo with Ease</strong> series🔥🔥.</p>
<h3 id="heading-first-of-all-why-this-series"><strong>First of all Why this Series?</strong></h3>
<p>You must have seen many Folks, said on their socials that he/she has solved 500 Problems, 1000 Problems etc. But I believe the Number of Questions does not matter it you don't know concept behind the Data Structure and Algorithm.</p>
<p>So Yeah In this Series we will solve 184 Questions which is more than enough to learn and revise the concepts of DSA.</p>
<h3 id="heading-prerequisites"><strong>Prerequisites 🤔:</strong></h3>
<p>So, You must be familiar with an Object Oriented Programming language like CPP, Java, and Python. But In this series, we will focus on concepts, not languages.</p>
<p>I will code in CPP but you can convert it to any language you want using an AI tool 🔧.</p>
<h3 id="heading-first-problem"><strong>First Problem:-</strong></h3>
<p><strong><mark>Set Matrix Zero: </mark></strong> <a target="_blank" href="https://leetcode.com/problems/set-matrix-zeroes/description/"><mark>Try this</mark></a></p>
<p>Let's understand the Problem First, basically, it says you have a m*n matrix and in that whenever you see 0 then set all the row elements and column elements of that particular row into 0.</p>
<p><mark>Example:</mark></p>
<p><img src="https://assets.leetcode.com/uploads/2020/08/17/mat1.jpg" alt /></p>
<p>in the above example if you carefully observe, at (1,1) index element is Zero so we have to initialize row=1 and column=1 to 0.</p>
<h3 id="heading-first-brute-force-approach"><strong><mark>First (Brute-Force) Approach:</mark></strong></h3>
<p><strong>The Brute-force solution that everyone can think of is traversing the entire matrix.</strong></p>
<p><strong>Steps:</strong></p>
<ul>
<li><p>Traverse in the matrix and when you got 0 then convert the entire column and row=-1.</p>
</li>
<li><p>and then initialize all the -1 into 0.</p>
</li>
</ul>
<p>Now many of you have doubts that why we are converting the entire column and row into -1 Why NOT 0?</p>
<p>You can see the difference below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685906198426/76f7451a-cdd7-4eda-8680-38c3b0518d34.jpeg" alt class="image--center mx-auto" /></p>
<p>when we use 0, then remember we are also traversing at the same time so there are possibilities that another zero can occur (which is converted by a Zero not in the initial problem) that's why we are using -1 so that we can keep track of index which are actually change because of a 0.</p>
<p><strong>Time Complexity: O(n*m) [Traversing Matrix] + O(n*m) [Converting row and column into -1] + O(n*M) [Initilizing -1 to 0].</strong></p>
<p><strong>Space Complexity: We are not using any extra space so O(1)</strong></p>
<p><strong><mark>code:</mark></strong></p>
<pre><code class="lang-cpp"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">markRow</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; &amp;matrix, <span class="hljs-keyword">int</span> n, <span class="hljs-keyword">int</span> m, <span class="hljs-keyword">int</span> i)</span> </span>{
    <span class="hljs-comment">// set all non-zero elements as -1 in the row i:</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j &lt; m; j++) {
        <span class="hljs-keyword">if</span> (matrix[i][j] != <span class="hljs-number">0</span>) {
            matrix[i][j] = <span class="hljs-number">-1</span>;
        }
    }
}


<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">markCol</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; &amp;matrix, <span class="hljs-keyword">int</span> n, <span class="hljs-keyword">int</span> m, <span class="hljs-keyword">int</span> j)</span> </span>{
    <span class="hljs-comment">// set all non-zero elements as -1 in the col j:</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++) {
        <span class="hljs-keyword">if</span> (matrix[i][j] != <span class="hljs-number">0</span>) {
            matrix[i][j] = <span class="hljs-number">-1</span>;
        }
    }
}

<span class="hljs-function"><span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; <span class="hljs-title">zeroMatrix</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; &amp;matrix, <span class="hljs-keyword">int</span> n, <span class="hljs-keyword">int</span> m)</span> </span>{

    <span class="hljs-comment">// Set -1 for rows and cols</span>
    <span class="hljs-comment">// that contains 0. Don't mark any 0 as -1:</span>

    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++) {
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j &lt; m; j++) {
            <span class="hljs-keyword">if</span> (matrix[i][j] == <span class="hljs-number">0</span>) {
                markRow(matrix, n, m, i);
                markCol(matrix, n, m, j);
            }
        }
    }

    <span class="hljs-comment">// Finally, mark all -1 as 0:</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++) {
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j &lt; m; j++) {
            <span class="hljs-keyword">if</span> (matrix[i][j] == <span class="hljs-number">-1</span>) {
                matrix[i][j] = <span class="hljs-number">0</span>;
            }
        }
    }

    <span class="hljs-keyword">return</span> matrix;
}
</code></pre>
<h3 id="heading-optimal-approach"><strong><mark>Optimal Approach:</mark></strong></h3>
<p><strong>Using Column and Row array to store the index of Zero:</strong></p>
<p><strong>Steps:</strong></p>
<ul>
<li><p>Traverse Matrix and whenever you get 0 stores the index of the row into the row array and column into the column array.</p>
</li>
<li><p>Traver Matrix again for Row and Column which we have to initialize with 0 and do that.</p>
</li>
</ul>
<p><strong>Time Complexity: O(n*m) [Traversing First time] + O(n*m) [Traversing Second time].</strong></p>
<p><strong>Space Complexity: O(n) + O(m) where n is the number of element in column and m is the number of element in row.</strong></p>
<p><strong><mark>Code:</mark></strong></p>
<pre><code class="lang-cpp"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">setZeros</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; &amp;matrix)</span>
</span>{
        <span class="hljs-keyword">int</span> m = matrix[<span class="hljs-number">0</span>].size();
        <span class="hljs-keyword">int</span> n = matrix.size();
        <span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;x;
        <span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;y;

        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>; i&lt;n; i++){
            <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> j=<span class="hljs-number">0</span>; j&lt;m; j++){
                <span class="hljs-keyword">if</span>(matrix[i][j] == <span class="hljs-number">0</span>){
                    x.push_back(i);
                    y.push_back(j);
                }
            }
        }

        <span class="hljs-comment">// for coverting rows into zero</span>
        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>; i&lt;x.size(); i++){
            <span class="hljs-keyword">int</span> ind = x[i];
            <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> j=<span class="hljs-number">0</span>; j&lt;m; j++){
                matrix[ind][j] = <span class="hljs-number">0</span>;
            }
        }
        <span class="hljs-comment">// for converting columns into zero</span>
        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>; i&lt;y.size(); i++){
            <span class="hljs-keyword">int</span> ind = y[i];
            <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> j=<span class="hljs-number">0</span>; j&lt;n; j++){
                matrix[j][ind] = <span class="hljs-number">0</span>;
            }
        }
}
</code></pre>
<p>Thank You so much everyone for reading this blog I hope it will be helpful for you in that case do like it and follow me at my socials:</p>
<p><a target="_blank" href="https://twitter.com/PrashantSony6">My Twitter</a></p>
<p><a target="_blank" href="https://www.linkedin.com/in/prashant-varma-666735230/">My LinkedIn</a></p>
]]></content:encoded></item></channel></rss>