<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shortest path in matrix - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/shortest-path-in-matrix/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/shortest-path-in-matrix/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 13 Sep 2021 06:19:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>shortest path in matrix - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/shortest-path-in-matrix/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What are the Minimum Initial Points to Reach Destination ?</title>
		<link>https://www.wikitechy.com/interview-questions/data-structure/what-are-the-minimum-initial-points-to-reach-destination/</link>
					<comments>https://www.wikitechy.com/interview-questions/data-structure/what-are-the-minimum-initial-points-to-reach-destination/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 17:44:33 +0000</pubDate>
				<category><![CDATA[Data Structure]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Altimetrik India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Bharti Airtel interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[bottom and up moves allowed]]></category>
		<category><![CDATA[bottom moves allowed]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Te interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[find minimum moves to reach target on an infinite line]]></category>
		<category><![CDATA[find shortest path in 2d array in c]]></category>
		<category><![CDATA[find shortest path in matrix python]]></category>
		<category><![CDATA[find the minimum number of moves needed to move from one cell of matrix to another]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Genpact interview questions and answers]]></category>
		<category><![CDATA[Globallogic India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[maximum cost path dynamic programm]]></category>
		<category><![CDATA[min cost flow]]></category>
		<category><![CDATA[minimum cost path]]></category>
		<category><![CDATA[minimum cost path dijkstra]]></category>
		<category><![CDATA[minimum cost path graph]]></category>
		<category><![CDATA[minimum cost path matrix java]]></category>
		<category><![CDATA[minimum cost path with left]]></category>
		<category><![CDATA[minimum cost path with right]]></category>
		<category><![CDATA[minimum number of jumps to reach end in java]]></category>
		<category><![CDATA[minimum number of jumps to reach end python]]></category>
		<category><![CDATA[minimum number of steps to reach a given number]]></category>
		<category><![CDATA[minimum steps to one dynamic programming]]></category>
		<category><![CDATA[minimum steps to reach a destination java]]></category>
		<category><![CDATA[minimum sum descent dynamic programming]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[samsung interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Sapient Consulting Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[shortest distance between two cells in a matrix or grid java]]></category>
		<category><![CDATA[shortest path between two points in a grid java]]></category>
		<category><![CDATA[shortest path from source to destination in matrix java]]></category>
		<category><![CDATA[shortest path in grid with obstacles]]></category>
		<category><![CDATA[shortest path in grid with obstacles python]]></category>
		<category><![CDATA[shortest path in matrix]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tracxn Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[WM Global Technology Services India Pvt.Ltd Limited (WMGTS) interview questions and answers]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Yodlee Infotech Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=511</guid>

					<description><![CDATA[Answer : To begin from the upper left corner of a given framework...]]></description>
										<content:encoded><![CDATA[<div>
<div class="hddn">
<h2 id="what-are-the-minimum-initial-points-to-reach-destination" class="color-pink" style="text-align: justify;">What are the Minimum Initial Points to Reach Destination ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>To begin from the upper left corner of a given framework, one needs to achieve the base right corner.</li>
<li>Every cell in the grid contains a number, the number may positive or negative.</li>
<li>We can move across a cell only if we have positive points ( &gt; 0 ). Whenever we pass through a cell, points in that cell are added to our overall points.</li>
<li>We need to find minimum initial points to reach cell (m-1, n-1) from (0, 0) by following these certain set of rules :</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>From a cell (i, j) we can move to (i+1, j) or (i, j+1).</li>
<li>We cannot move from (i, j) if your overall points at (i, j) is &lt;= 0.</li>
<li>We have to reach at (n-1, m-1) with minimum positive points i.e., &gt; 0.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="syntax" class="color-purple">Syntax</h2>
</div>
</div>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs scss" data-lang=""><span class="nt"><span class="hljs-function">minInitTokens</span>(matrix) </span></code></pre>
</figure>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-c" class="color-purple" style="text-align: justify;">Sample Code in C++</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-cpp code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-cpp code-embed-code">#include&lt;iostream&gt;<br/>#include&lt;cmath&gt;<br/>#define ROW 3<br/>#define COL 3<br/>using namespace std;<br/><br/>int tokens[ROW][COL] = {<br/>   {-2,-3,3},<br/>   {-5,-10,1},<br/>   {10,30,-5}<br/>};<br/><br/>int max(int a, int b) {<br/>   return (a&gt;b)?a:b;<br/>}<br/><br/>int minInitPoints() {<br/>   int minToken[ROW][COL];<br/>   int m = ROW, n = COL;<br/>   <br/>   minToken[m-1][n-1] = tokens[m-1][n-1] &gt; 0? 1: abs(tokens[m-1][n-1]) + 1;<br/>   <br/>   for (int i = m-2; i &gt;= 0; i--)    //from last row to first row, fill points<br/>      minToken[i][n-1] = max(minToken[i+1][n-1] - tokens[i][n-1], 1);<br/>   <br/>   for (int j = n-2; j &gt;= 0; j--)    //fill last column to first column, fill points<br/>      minToken[m-1][j] = max(minToken[m-1][j+1] - tokens[m-1][j], 1);<br/><br/>   for (int i=m-2; i&gt;=0; i--) {<br/>      for (int j=n-2; j&gt;=0; j--) {<br/>         int remPoint = min(minToken[i+1][j], minToken[i][j+1]);    //calculate remaining points<br/>         minToken[i][j] = max(remPoint - tokens[i][j], 1);<br/>      }<br/>   }<br/>   return minToken[0][0];<br/>}<br/><br/>int main() {<br/>   cout &lt;&lt; &quot;Least Points Required: &quot; &lt;&lt; minInitPoints();<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-purple">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs" data-lang=""><span class="nt">Least Points Required: 7</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/data-structure/what-are-the-minimum-initial-points-to-reach-destination/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
