<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rutuja Bhombe on Medium]]></title>
        <description><![CDATA[Stories by Rutuja Bhombe on Medium]]></description>
        <link>https://medium.com/@rutujakbhombe19?source=rss-9092bdfbd533------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TJ9yXlIiLjGN_sw-NAyaiA.jpeg</url>
            <title>Stories by Rutuja Bhombe on Medium</title>
            <link>https://medium.com/@rutujakbhombe19?source=rss-9092bdfbd533------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:50:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rutujakbhombe19/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Leetcode 51: N-Queens]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-51-n-queens-99d24a911585?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/99d24a911585</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[leetcode-solution]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Mon, 08 Dec 2025 18:23:21 GMT</pubDate>
            <atom:updated>2025-12-08T18:23:21.342Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYiEBkuy7Aq6747zZc28NA.png" /><figcaption>Solution</figcaption></figure><p>The <strong>n-queens</strong> puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.</p><p>Given an integer n, return <em>all distinct solutions to the </em><strong><em>n-queens puzzle</em></strong>. You may return the answer in <strong>any order</strong>.</p><p>Each solution contains a distinct board configuration of the n-queens’ placement, where &#39;Q&#39; and &#39;.&#39; both indicate a queen and an empty space, respectively.</p><p><strong>Example 1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/0*KtlXDbc2zt-5yDbQ.jpg" /></figure><pre>Input: n = 4<br>Output: [[&quot;.Q..&quot;,&quot;...Q&quot;,&quot;Q...&quot;,&quot;..Q.&quot;],[&quot;..Q.&quot;,&quot;Q...&quot;,&quot;...Q&quot;,&quot;.Q..&quot;]]<br>Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above</pre><p><strong>Example 2:</strong></p><pre>Input: n = 1<br>Output: [[&quot;Q&quot;]]</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= n &lt;= 9</li></ul><p>C++</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*hcqQiELSOWmpORuBau8TrQ.png" /><figcaption>C++ solution</figcaption></figure><p>Java</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*rUiJdxs5WVb2ylhEHKEFvQ.png" /><figcaption>Java solution</figcaption></figure><p>Python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*_whI4nbaHtrtmTiIP_S7Tg.png" /></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99d24a911585" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 50 : Pow (x,n)]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-50-pow-x-n-46521b0f4235?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/46521b0f4235</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 14:55:52 GMT</pubDate>
            <atom:updated>2025-10-15T14:55:52.602Z</atom:updated>
            <content:encoded><![CDATA[<h3>Leetcode 50 : Pow (x,n)</h3><h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1HYHSrx8zNz4eBcvdtGww.png" /><figcaption>Solution</figcaption></figure><p>Implement <a href="http://www.cplusplus.com/reference/valarray/pow/">pow(x, n)</a>, which calculates x raised to the power n (i.e., xn).</p><p><strong>Example 1:</strong></p><pre>Input: x = 2.00000, n = 10<br>Output: 1024.00000</pre><p><strong>Example 2:</strong></p><pre>Input: x = 2.10000, n = 3<br>Output: 9.26100</pre><p><strong>Example 3:</strong></p><pre>Input: x = 2.00000, n = -2<br>Output: 0.25000<br>Explanation: 2-2 = 1/22 = 1/4 = 0.25</pre><p><strong>Constraints:</strong></p><ul><li>-100.0 &lt; x &lt; 100.0</li><li>-231 &lt;= n &lt;= 231-1</li><li>n is an integer.</li><li>Either x is not zero or n &gt; 0.</li><li>-104 &lt;= xn &lt;= 104</li></ul><p>C++</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*ckuyDPTyxk9jbfeTf6botA.png" /><figcaption>Solution</figcaption></figure><p>Java</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*-DmFzOHxGjYldlPl9FpSVw.png" /><figcaption>Solution</figcaption></figure><p>Python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*3-pQZg2KsiZYZkGl4WWDAQ.png" /><figcaption>Solution</figcaption></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46521b0f4235" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 49: Group Anagrams]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-49-group-anagrams-371d6a811145?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/371d6a811145</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 17:34:06 GMT</pubDate>
            <atom:updated>2025-10-07T17:34:06.870Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJv_X3Kr_q_C_EajgoDvFg.png" /><figcaption>Solution</figcaption></figure><p>Given an array of strings strs, group the anagrams together. You can return the answer in <strong>any order</strong>.</p><p><strong>Example 1:</strong></p><p><strong>Input:</strong> strs = [“eat”,”tea”,”tan”,”ate”,”nat”,”bat”]</p><p><strong>Output:</strong> [[“bat”],[“nat”,”tan”],[“ate”,”eat”,”tea”]]</p><p><strong>Explanation:</strong></p><ul><li>There is no string in strs that can be rearranged to form &quot;bat&quot;.</li><li>The strings &quot;nat&quot; and &quot;tan&quot; are anagrams as they can be rearranged to form each other.</li><li>The strings &quot;ate&quot;, &quot;eat&quot;, and &quot;tea&quot; are anagrams as they can be rearranged to form each other.</li></ul><p><strong>Example 2:</strong></p><p><strong>Input:</strong> strs = [“”]</p><p><strong>Output:</strong> [[“”]]</p><p><strong>Example 3:</strong></p><p><strong>Input:</strong> strs = [“a”]</p><p><strong>Output:</strong> [[“a”]]</p><p><strong>Constraints:</strong></p><ul><li>1 &lt;= strs.length &lt;= 104</li><li>0 &lt;= strs[i].length &lt;= 100</li><li>strs[i] consists of lowercase English letters.</li></ul><p>C ++ :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*bmWJ5HLKXAhwrct-H00I4A.png" /><figcaption>C++ in Solution</figcaption></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=371d6a811145" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 48:Rotate Image]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-48-rotate-image-d3dfbfa2d7a9?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3dfbfa2d7a9</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 06:29:42 GMT</pubDate>
            <atom:updated>2025-04-14T06:29:42.063Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OR4himM2m83hBmzLLXGVmw.png" /><figcaption>Solution</figcaption></figure><p>You are given an n x n 2D matrix representing an image, rotate the image by <strong>90</strong> degrees (clockwise).</p><p>You have to rotate the image <a href="https://en.wikipedia.org/wiki/In-place_algorithm"><strong>in-place</strong></a>, which means you have to modify the input 2D matrix directly. <strong>DO NOT</strong> allocate another 2D matrix and do the rotation.</p><p><strong>Example 1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*PmGcOhMab-0tsaRe.jpg" /></figure><pre>Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]<br>Output: [[7,4,1],[8,5,2],[9,6,3]]</pre><p><strong>Example 2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*tklhf7gteVs01dO5.jpg" /></figure><pre>Input: matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]<br>Output: [[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]</pre><p><strong>Constraints:</strong></p><ul><li>n == matrix.length == matrix[i].length</li><li>1 &lt;= n &lt;= 20</li><li>-1000 &lt;= matrix[i][j] &lt;= 1000</li></ul><p>Solution :</p><p><strong>C++:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*fPR5eBxagv5P0n-YGStr0w.png" /><figcaption>C++</figcaption></figure><p>Java:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*RCLzMqexMEzIStenuQ9EbQ.png" /><figcaption>Java</figcaption></figure><p>Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*EmeFtQuCFTzv69Ss9pPeTg.png" /><figcaption>Python</figcaption></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3dfbfa2d7a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Will the War of AI Ever End?]]></title>
            <link>https://medium.com/@rutujakbhombe19/will-the-war-of-ai-ever-end-ace60cf1792a?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/ace60cf1792a</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 19:09:11 GMT</pubDate>
            <atom:updated>2025-03-06T19:12:45.548Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9drKwLaSpXvZpjUOawAtQ.png" /><figcaption>generated with DALL.E</figcaption></figure><p>Artificial intelligence is not merely about creating smarter algorithms — it has become a global war zone. From intense geopolitical rivalry to corporate wars and ethical controversies, the “war of AI” reshapes power, economy, and security in the 21st century. But will this war ever end?</p><p><strong><em>A Global Arms Race</em></strong></p><p>Over the past few years, AI has become a proxy for global influence. China’s announcement of the DeepSeek AI model, which allegedly rivaled American technological superiority despite not having access to the newest U.S. semiconductor chips, has marked a significant shift in competition. According to one article in <strong>The Times</strong>, DeepSeek’s triumph has been likened to a contemporary Sputnik moment — a surprise advance that shook world markets and questioned whether the U.S. would continue to hold its position of superiority. </p><p>While that’s happening, the United States is also investing in its domestic battles. U.S. national security adviser <strong>Jake Sullivan</strong> recently cautioned that not keeping up with China in the AI race could have “dramatic” and even “catastrophic” implications. His point is well made: the next few years are key to making sure that AI technologies are advanced both safely and ethically, and yet keeping national interests a priority. </p><p><strong><em>The Corporate Battlefront</em></strong></p><p>Not only countries are engaged in a war — but tech companies are also in intense competition. Tech companies such as Google, Meta, OpenAI, and upstart players are competing on market share, people, and regulatory clout. Critics say that this competition is too often at the cost of safety and ethics, with some companies reportedly “privatizing the profits and socializing the risks.” </p><p>Additionally, proposals like <strong>California’s SB 1047</strong> and the EU’s multibillion-euro AI investments demonstrate the dilemma of striking a balance between regulation and innovation. While governments seek to protect citizens and encourage equitable competition, most fear over-regulation will dampen the same creativity fueling technological advances.</p><p><strong><em>Ethical and Existential Concerns</em></strong></p><p>Aside from economics and the pride of the nation, most experts are gravely concerned about the existential threats of an unregulated AI arms race. Philosophers such as Nick Bostrom and scientists such as Geoffrey Hinton have cautioned that if AI systems continue to develop unaligned with human values, the results will be disastrous — possibly even catastrophic. Hinton, who recently departed Google to discuss more candidly the peril of AI, has voiced increasing concern that the fast-paced advancements in AI may ultimately result in a situation where machines create goals incompatible with ours. citeturn0search51</p><p>These fears have provoked demands for a worldwide regulatory framework. Most are convinced that the risks can be controlled only with international cooperation and openness. The concept of an “AI arms control” regime, akin to nuclear non-proliferation agreements, is gaining traction with policymakers and analysts.</p><p><strong><em>Is Peace Possible?</em></strong></p><p>Will the war on AI ever cease? One possible answer is collaboration. In place of a zero-sum contest, the future may be to develop global norms and ethical standards for AI innovation — where states, companies, and scientists unite to make sure that AI serves humanity in general.</p><p>For instance, events such as the AI Safety Summit have already gathered representatives from across nations to address responsible AI frameworks. Calls for global treaties, collective research into AI safety, and collective investments in ethical AI innovation could lay the groundwork for peaceful coexistence within an ever-changing digital environment.</p><p>Yet this will be accomplished only by surmounting deeply ingrained suspicion. As seen in anxieties about “AI nationalism,” the U.S. and China both have more tightly controlled strategies, frequently equating technological progress with national defense. Shattering these barriers will necessitate historic diplomacy and mutual compromises.</p><p><strong><em>Looking to the Future</em></strong></p><p>The AI war is as much a struggle for minds and markets as it is for moral clarity and international stability. Though the journey to peace is fraught with peril — from reconciling economic growth with moral responsibility to making sure progress does not serve as an instrument of oppression — the potential rewards of a cooperative approach are staggering.</p><p>Envision a future where AI closes learning disparities, improves health globally, and generates new sectors that serve the world’s good, not the interests of a few dominant states or companies. The path to such a future will involve ongoing research, policymaking, and global conversation.</p><p>In summary, whether the AI war will end is to a great extent dependent on our ability to participate in sincere, cooperative global governance. It’s a high-stakes race in which the price of failure may be existential, but the benefits of a peaceful, innovative future are just as revolutionary.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ace60cf1792a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 47:Permutations II]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-47-permutations-ii-69b8fb9eba00?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/69b8fb9eba00</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[dsa-courses]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 17:44:50 GMT</pubDate>
            <atom:updated>2025-01-20T17:44:50.757Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfeMKMZLYgI8ifx4MkVxMQ.png" /></figure><p>Given a collection of numbers, nums, that might contain duplicates, return <em>all possible unique permutations </em><strong><em>in any order</em></strong><em>.</em></p><p><strong>Example 1:</strong></p><pre>Input: nums = [1,1,2]<br>Output:<br>[[1,1,2],<br> [1,2,1],<br> [2,1,1]]</pre><p><strong>Example 2:</strong></p><pre>Input: nums = [1,2,3]<br>Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= nums.length &lt;= 8</li><li>-10 &lt;= nums[i] &lt;= 10</li></ul><p>Solution :</p><p>To solve the problem of finding all unique permutations of a list of numbers that may include duplicates, the key steps are as follows:</p><ol><li><strong>Sort the Input Array</strong>: Sorting helps in easily skipping duplicate values during the recursive backtracking process.</li><li><strong>Use Backtracking</strong>: Recursively construct permutations while maintaining a path and marking elements as used.</li><li><strong>Skip Duplicates</strong>: Ensure that when duplicates exist, only the first unused occurrence of a number at the same level of recursion is processed.</li></ol><p>C++:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*-4OIqR5aYlb50VdfROAJew.png" /></figure><p>Java:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*JvXKsTIX6t8Ftk30qFr7jw.png" /><figcaption>Java</figcaption></figure><p>Python :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*va2nRVB7G6r4UTY05RCXyw.png" /></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69b8fb9eba00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 46:Permutation]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-46-permutation-41ec8871d165?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/41ec8871d165</guid>
            <category><![CDATA[leetcode-solution]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 16:56:16 GMT</pubDate>
            <atom:updated>2025-01-01T16:57:43.981Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2GwRSK21X0saOZ8onFh-mg.png" /><figcaption>Solution</figcaption></figure><p>Given an array nums of distinct integers, return all the possible permutations</p><p>. You can return the answer in <strong>any order</strong>.</p><p><strong>Example 1:</strong></p><pre>Input: nums = [1,2,3]<br>Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]</pre><p><strong>Example 2:</strong></p><pre>Input: nums = [0,1]<br>Output: [[0,1],[1,0]]</pre><p><strong>Example 3:</strong></p><pre>Input: nums = [1]<br>Output: [[1]]</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= nums.length &lt;= 6</li><li>-10 &lt;= nums[i] &lt;= 10</li><li>All the integers of nums are <strong>unique</strong>.</li></ul><h3>Key Points:</h3><ul><li><strong>Input</strong>: A list of distinct integers.</li><li><strong>Output</strong>: All possible permutations (orderings) of the list.</li><li><strong>Constraints</strong>:</li><li>Array length is small (1 ≤ nums.length ≤ 6), allowing for factorial growth in the number of permutations.</li><li>Each integer in the list is unique.</li></ul><h3>Examples:</h3><ol><li><strong>Input</strong>: nums = [1, 2, 3]<br><strong>Output</strong>: [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]</li><li><strong>Input</strong>: nums = [0, 1]<br><strong>Output</strong>: [[0, 1], [1, 0]]</li><li><strong>Input</strong>: nums = [1]<br><strong>Output</strong>: [[1]]</li></ol><h3>Algorithm:</h3><p>To solve this, we can use <strong>backtracking</strong>, which explores all possible orderings of the elements in the array.</p><ol><li><strong>Base Case</strong>: If the permutation being formed is the same length asnums add it to the result list.</li><li><strong>Recursive Case</strong>: Iterate through the elements, skipping the ones already used, and recursively build the permutation.</li><li>Backtrack by removing the last added element after exploring deeper levels.</li></ol><h3>Solution :</h3><p>C++:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*G2abI_QcS0Wrp4_QIsREaA.png" /></figure><p>Java:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*2UTH417PtCD6D_TLFyodqA.png" /></figure><p>Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*K9Wl8UhCZsa1kG32deSkfA.png" /></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41ec8871d165" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 45: Jump Game II]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-45-jump-game-ii-b7f7cb0647a8?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7f7cb0647a8</guid>
            <category><![CDATA[leetcode-medium]]></category>
            <category><![CDATA[leetcode-solution]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 16:43:39 GMT</pubDate>
            <atom:updated>2025-01-01T16:43:39.860Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nFFxQ8s8yWaF2ItOLS1ssQ.png" /><figcaption>Solution</figcaption></figure><p>You are given a <strong>0-indexed</strong> array of integers nums of length n. You are initially positioned at nums[0].</p><p>Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you can jump to any nums[i + j] where:</p><ul><li>0 &lt;= j &lt;= nums[i] and</li><li>i + j &lt; n</li></ul><p>Return <em>the minimum number of jumps to reach </em>nums[n - 1]. The test cases are generated such that you can reach nums[n - 1].</p><p><strong>Example 1:</strong></p><pre>Input: nums = [2,3,1,1,4]<br>Output: 2<br>Explanation: The minimum number of jumps to reach the last index is 2. Jump 1 step from index 0 to 1, then 3 steps to the last index.</pre><p><strong>Example 2:</strong></p><pre>Input: nums = [2,3,0,1,4]<br>Output: 2</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= nums.length &lt;= 104</li><li>0 &lt;= nums[i] &lt;= 1000</li><li>It’s guaranteed that you can reach nums[n - 1].</li></ul><h3><strong>Programming Approach :</strong></h3><p><strong>Greedy BFS (Breadth-First Search)</strong>. Here’s how it works:</p><ol><li><strong>Greedy Choice</strong>: At every step, the algorithm computes the farthest point that can be reached from the current level. It updates this farthest point by taking the maximum of all reachable indices from the current index.</li><li><strong>Level Traversal</strong>: The end variable tracks the current level in the BFS. When i reaches end, it means all indices of the current &quot;level&quot; have been explored. The ans is incremented to move to the next level.</li><li><strong>Early Termination</strong>: If the farthest point (farthest) exceeds or equals the last index (nums.length - 1 or len(nums) - 1), the algorithm terminates early, as the destination can be reached.</li></ol><h3>Solution :</h3><p>C++</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*yN9gPwKl40Tb_IYyem4EUA.png" /></figure><p>Java:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*jtBmioQAlf5h7KAHn9sctA.png" /></figure><p>Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*GE0sdI8nQLpuYuHMD0s8aA.png" /></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7f7cb0647a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 44: Wildcard Matching]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-44-wildcard-matching-c25f0e1513cc?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/c25f0e1513cc</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[leetcode-hard]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[leetcode-solution]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Wed, 13 Nov 2024 07:26:51 GMT</pubDate>
            <atom:updated>2024-11-13T07:26:51.957Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSSZt3DqNAGeBXuQ0dKPXg.png" /><figcaption>Solution</figcaption></figure><p>Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for &#39;?&#39; and &#39;*&#39; where:</p><ul><li>&#39;?&#39; Matches any single character.</li><li>&#39;*&#39; Matches any sequence of characters (including the empty sequence).</li></ul><p>The matching should cover the <strong>entire</strong> input string (not partial).</p><p><strong>Example 1:</strong></p><pre>Input: s = &quot;aa&quot;, p = &quot;a&quot;<br>Output: false<br>Explanation: &quot;a&quot; does not match the entire string &quot;aa&quot;.</pre><p><strong>Example 2:</strong></p><pre>Input: s = &quot;aa&quot;, p = &quot;*&quot;<br>Output: true<br>Explanation: &#39;*&#39; matches any sequence.</pre><p><strong>Example 3:</strong></p><pre>Input: s = &quot;cb&quot;, p = &quot;?a&quot;<br>Output: false<br>Explanation: &#39;?&#39; matches &#39;c&#39;, but the second letter is &#39;a&#39;, which does not match &#39;b&#39;.</pre><p><strong>Constraints:</strong></p><ul><li>0 &lt;= s.length, p.length &lt;= 2000</li><li>s contains only lowercase English letters.</li><li>p contains only lowercase English letters, &#39;?&#39; or &#39;*&#39;.</li></ul><h3>Dynamic Programming Approach</h3><p>The dynamic programming (DP) solution involves creating a 2D DP array where dp[i][j] represents whether s[0..i) matches p[0..j). The solution is based on filling in this DP table by analyzing each character in s and p iteratively. Here’s a breakdown of the steps:</p><p><strong>1. Initialization</strong>:</p><ul><li>Set dp[0][0] to true because an empty pattern matches an empty string.</li><li>For patterns beginning with &#39;*&#39;, if it can match an empty sequence, propagate true across dp[0][j].</li></ul><p><strong>2. Filling the DP Table</strong>:</p><ul><li><strong>If </strong><strong>p[j] is </strong><strong>&#39;*&#39;</strong>: It can either match zero characters (look at dp[i+1][j]) or more characters (look at dp[i][j+1]).</li><li><strong>If </strong><strong>p[j] is </strong><strong>&#39;?&#39; or matches </strong><strong>s[i]</strong>: Propagate the match by setting dp[i+1][j+1] to dp[i][j].</li></ul><p><strong>3. Result</strong>: dp[m][n] will hold whether the entire string s matches the pattern p.</p><h3>Solution :</h3><p>C++</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*GFtxgEKbuM1vBwlePccGuQ.png" /></figure><p>Java:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*6gcDAsXqZUZ4ptG03MXNng.png" /></figure><p>Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*KstW9gNob_5iWqGBGM3meg.png" /></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c25f0e1513cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 43: Multiply Strings]]></title>
            <link>https://medium.com/@rutujakbhombe19/leetcode-43-multiply-strings-fc9d3af30361?source=rss-9092bdfbd533------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc9d3af30361</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[leetcode-medium]]></category>
            <dc:creator><![CDATA[Rutuja Bhombe]]></dc:creator>
            <pubDate>Sun, 20 Oct 2024 15:55:12 GMT</pubDate>
            <atom:updated>2024-10-20T15:55:12.399Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving Leetcode until I land a job!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcXZ7M9VYNl2N-iHFM_9_g.png" /><figcaption>Solution</figcaption></figure><p>Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.</p><p><strong>Note:</strong> You must not use any built-in BigInteger library or convert the inputs to integers directly.</p><p><strong>Example 1:</strong></p><pre>Input: num1 = &quot;2&quot;, num2 = &quot;3&quot;<br>Output: &quot;6&quot;</pre><p><strong>Example 2:</strong></p><pre>Input: num1 = &quot;123&quot;, num2 = &quot;456&quot;<br>Output: &quot;56088&quot;</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= num1.length, num2.length &lt;= 200</li><li>num1 and num2 consist of digits only.</li><li>Both num1 and num2 do not contain any leading zero, except the number 0 itself.</li></ul><p>You are given two non-negative integers num1 and num2 represented as <strong>strings</strong>. You are tasked with returning the <strong>product</strong> of these two numbers, also represented as a string.</p><p>Key points:</p><ul><li><strong>No built-in BigInteger library</strong>: You are not allowed to use any built-in libraries to handle large numbers (like BigInteger).</li><li><strong>No direct conversion to integers</strong>: You cannot simply convert the input strings to integers and then perform multiplication.</li></ul><p>To solve this problem without using large number handling libraries or direct integer conversion, we can simulate the process of multiplying two numbers the same way you would do by hand.</p><h4>Multiplication process (just like on paper):</h4><p>When you multiply two numbers on paper:</p><ol><li>You take one digit from the first number (num1) and multiply it by each digit of the second number (num2).</li><li>You align the products based on the position of the digits.</li><li>You sum the intermediate results, accounting for carry-over.</li></ol><p>We’ll follow a similar approach using arrays to store intermediate results.</p><blockquote>Steps:</blockquote><blockquote><strong>Initialize an array for the result</strong>:</blockquote><blockquote>The maximum length of the result will be the sum of the lengths of num1 and num2 because multiplying two n-digit numbers can result in up to 2n digits.</blockquote><blockquote><strong>Multiply each digit of </strong><strong>num1 by each digit of </strong><strong>num2</strong>:</blockquote><blockquote>For each digit in num1 (starting from the rightmost digit), multiply it by each digit in num2 (also starting from the rightmost digit).</blockquote><blockquote>Store the result at the appropriate index in the result array, which corresponds to the position in the final product.</blockquote><blockquote><strong>Handle carry-over</strong>:</blockquote><blockquote>Just like in manual multiplication, when a product is greater than 9, you’ll need to carry over the tens place to the next index in the result array.</blockquote><blockquote><strong>Convert the result array to a string</strong>:</blockquote><blockquote>Skip any leading zeros in the result array and convert the digits to a string.</blockquote><blockquote>Return &quot;0&quot; if the result is all zeros.</blockquote><blockquote>Detailed Explanation of the Approach:</blockquote><blockquote><strong>Initialize a result array</strong>:</blockquote><blockquote>Length of the result array will be len(num1) + len(num2). Let&#39;s say num1 has m digits and num2 has n digits, so we create an array result of size m + n initialized to zero.</blockquote><blockquote><strong>Perform the multiplication</strong>:</blockquote><blockquote>For each digit in num1 (indexed by i), we multiply it by each digit in num2 (indexed by j).</blockquote><blockquote>For each pair (i, j), we calculate the product of num1[i] * num2[j] and add it to the corresponding position in the result array. This position would be i + j + 1 for the ones place and i + j for the tens place.</blockquote><blockquote><strong>Manage carry</strong>:</blockquote><blockquote>If the result at a certain position is greater than 9, we update that position with the unit digit and carry over the tens digit to the next position.</blockquote><blockquote><strong>Convert result to a string</strong>:</blockquote><blockquote>After filling up the result array, we need to handle any leading zeros. The first non-zero digit marks the beginning of the actual number.</blockquote><blockquote>If all elements of the result are zeros, return “0”.</blockquote><p>C++:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*R-A1MTjk8qUTH_R0FLOEQQ.png" /><figcaption>C++</figcaption></figure><p>Java:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*z_KFVo0VKHlgBoybUzmcBw.png" /><figcaption>Java</figcaption></figure><p>Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*BPVD-F0tRePHd00YnHdlDw.png" /><figcaption>Python</figcaption></figure><p><strong>Stay tuned for the next problem!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc9d3af30361" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>