<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Debesh P.</title>
    <description>The latest articles on DEV Community by Debesh P. (@debeshpg90).</description>
    <link>https://dev.to/debeshpg90</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2792630%2F430eb5b4-ee16-43ee-9e89-c9df8d8102a2.png</url>
      <title>DEV Community: Debesh P.</title>
      <link>https://dev.to/debeshpg90</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/debeshpg90"/>
    <language>en</language>
    <item>
      <title>21. Merge Two Sorted Lists | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Tue, 17 Feb 2026 19:53:50 +0000</pubDate>
      <link>https://dev.to/debeshpg90/21-merge-two-sorted-lists-leetcode-top-interview-150-coding-questions-31pp</link>
      <guid>https://dev.to/debeshpg90/21-merge-two-sorted-lists-leetcode-top-interview-150-coding-questions-31pp</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/merge-two-sorted-lists/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/merge-two-sorted-lists/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/merge-two-sorted-lists/solutions/7587317/beats-1000-step-by-step-explanation-all-bkmtk" rel="noopener noreferrer"&gt;https://leetcode.com/problems/merge-two-sorted-lists/solutions/7587317/beats-1000-step-by-step-explanation-all-bkmtk&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkjnq8ur1iq0b5u0anjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkjnq8ur1iq0b5u0anjn.png" alt="leetcode 21" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public ListNode mergeTwoLists(ListNode list1, ListNode list2) {

        ListNode result = new ListNode(0);
        ListNode ptr = result;

        while (list1 != null &amp;amp;&amp;amp; list2 != null) {
            if (list1.val &amp;lt;= list2.val) {
                ptr.next = list1;
                list1 = list1.next;
            } else {
                ptr.next = list2;
                list2 = list2.next;
            }
            ptr = ptr.next;
        }

        if (list1 == null) ptr.next = list2;
        if (list2 == null) ptr.next = list1;

        return result.next;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>2. Add Two Numbers | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Mon, 16 Feb 2026 20:02:14 +0000</pubDate>
      <link>https://dev.to/debeshpg90/2-add-two-numbers-leetcode-top-interview-150-coding-questions-3i84</link>
      <guid>https://dev.to/debeshpg90/2-add-two-numbers-leetcode-top-interview-150-coding-questions-3i84</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/add-two-numbers/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/add-two-numbers/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/add-two-numbers/solutions/7584850/beats-200-all-languages-using-linkedlist-nf53" rel="noopener noreferrer"&gt;https://leetcode.com/problems/add-two-numbers/solutions/7584850/beats-200-all-languages-using-linkedlist-nf53&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz07kekvq008niq8nxv6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz07kekvq008niq8nxv6v.png" alt="leetcode 2" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public ListNode addTwoNumbers(ListNode l1, ListNode l2) {

        ListNode result = new ListNode(0);
        ListNode ptr = result;
        int carry = 0;

        while (l1 != null || l2 != null) {
            int sum = 0 + carry;

            if (l1 != null) {
                sum += l1.val;
                l1 = l1.next;
            }

            if (l2 != null) {
                sum += l2.val;
                l2 = l2.next;
            }

            carry = sum / 10;
            sum = sum % 10;
            ptr.next = new ListNode(sum);
            ptr = ptr.next;
        }

        if (carry == 1) ptr.next = new ListNode(1);
        return result.next;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>141. Linked List Cycle | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Sun, 15 Feb 2026 19:24:56 +0000</pubDate>
      <link>https://dev.to/debeshpg90/141-linked-list-cycle-leetcode-top-interview-150-coding-questions-3ank</link>
      <guid>https://dev.to/debeshpg90/141-linked-list-cycle-leetcode-top-interview-150-coding-questions-3ank</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/linked-list-cycle/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/linked-list-cycle/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/linked-list-cycle/solutions/7582225/beats-200-floyds-cycle-detection-tortois-1vng" rel="noopener noreferrer"&gt;https://leetcode.com/problems/linked-list-cycle/solutions/7582225/beats-200-floyds-cycle-detection-tortois-1vng&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wb9xthgiu8c9zm4qk6a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wb9xthgiu8c9zm4qk6a.png" alt="leetcode 141" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Solution {
    public boolean hasCycle(ListNode head) {

        ListNode slowPtr = head;
        ListNode fastPtr = head;

        while (slowPtr != null &amp;amp;&amp;amp; fastPtr != null &amp;amp;&amp;amp; fastPtr.next != null) {
            slowPtr = slowPtr.next;
            fastPtr = fastPtr.next.next;

            if (slowPtr == fastPtr) {
                return true;
            }
        }

        return false;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>224. Basic Calculator | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Fri, 13 Feb 2026 16:58:06 +0000</pubDate>
      <link>https://dev.to/debeshpg90/224-basic-calculator-leetcode-top-interview-150-coding-questions-49b3</link>
      <guid>https://dev.to/debeshpg90/224-basic-calculator-leetcode-top-interview-150-coding-questions-49b3</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/basic-calculator/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/basic-calculator/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/basic-calculator/solutions/7576826/most-optimal-beats-100-all-languages-sta-jd4n" rel="noopener noreferrer"&gt;https://leetcode.com/problems/basic-calculator/solutions/7576826/most-optimal-beats-100-all-languages-sta-jd4n&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhms63ukkuass060xio6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhms63ukkuass060xio6v.png" alt="leetcode 224" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public int calculate(String s) {

        Stack&amp;lt;Integer&amp;gt; stack = new Stack&amp;lt;&amp;gt;();

        int res = 0;
        int curr = 0;
        int sign = 1;

        for (char c : s.toCharArray()) {
            if (Character.isDigit(c)) {
                curr = curr * 10 + (c - '0');
            } else if (c == '+') {
                res += curr * sign;
                sign = 1;
                curr = 0;
            } else if (c == '-') {
                res += curr * sign;
                sign = -1;
                curr = 0;
            } else if (c == '(') {
                stack.push(res);
                stack.push(sign);
                res = 0;
                sign = 1;
                curr = 0;
            } else if (c == ')') {
                res += curr * sign;
                curr = 0;
                res *= stack.pop();
                res += stack.pop();
            }
        }

        res += sign * curr;
        return res;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>150. Evaluate Reverse Polish Notation | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Wed, 11 Feb 2026 19:19:57 +0000</pubDate>
      <link>https://dev.to/debeshpg90/150-evaluate-reverse-polish-notation-leetcode-top-interview-150-coding-questions-22c9</link>
      <guid>https://dev.to/debeshpg90/150-evaluate-reverse-polish-notation-leetcode-top-interview-150-coding-questions-22c9</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/evaluate-reverse-polish-notation/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/evaluate-reverse-polish-notation/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/evaluate-reverse-polish-notation/solutions/7572013/most-optimal-solution-beats-500-stack-al-nrde" rel="noopener noreferrer"&gt;https://leetcode.com/problems/evaluate-reverse-polish-notation/solutions/7572013/most-optimal-solution-beats-500-stack-al-nrde&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkncegq7aligpd0jk459e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkncegq7aligpd0jk459e.png" alt="leetcode 150" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public int evalRPN(String[] tokens) {

        Stack&amp;lt;Integer&amp;gt; stack = new Stack&amp;lt;&amp;gt;();

        for (String token : tokens) {
            if (token.equals("+") || token.equals("-") ||
                token.equals("*") || token.equals("/")) {
                int b = stack.pop();
                int a = stack.pop();
                int res = operate(a, b, token);
                stack.push(res);
            } else {
                stack.push(Integer.parseInt(token));
            }
        }

        return stack.pop();
    }

    private int operate(int a, int b, String token) {
        switch (token) {
            case "+" : return a + b;
            case "-" : return a - b;
            case "*" : return a * b;
            case "/" : return a / b;
            default : return 0;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>155. Min Stack | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Tue, 10 Feb 2026 09:13:44 +0000</pubDate>
      <link>https://dev.to/debeshpg90/155-min-stack-leetcode-top-interview-150-coding-questions-128b</link>
      <guid>https://dev.to/debeshpg90/155-min-stack-leetcode-top-interview-150-coding-questions-128b</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/min-stack/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/min-stack/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/min-stack/solutions/7568000/most-optimal-code-beats-200-all-language-2flu" rel="noopener noreferrer"&gt;https://leetcode.com/problems/min-stack/solutions/7568000/most-optimal-code-beats-200-all-language-2flu&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffeqw60r41v730ixg4zrc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffeqw60r41v730ixg4zrc.png" alt="leetcode 155" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class MinStack {

    Stack&amp;lt;Integer&amp;gt; stack;
    Stack&amp;lt;Integer&amp;gt; minStack;

    public MinStack() {
        stack = new Stack&amp;lt;&amp;gt;();
        minStack = new Stack&amp;lt;&amp;gt;();
    }

    public void push(int val) {
        stack.push(val);
        if(minStack.isEmpty() || val &amp;lt;= minStack.peek()) {
            minStack.push(val);
        }
    }

    public void pop() {
        int poppedVal = stack.pop();
        if(poppedVal == minStack.peek()) {
            minStack.pop();
        }
    }

    public int top() {
        return stack.peek();
    }

    public int getMin() {
        return minStack.peek();
    }
}

/**
 * Your MinStack object will be instantiated and called as such:
 * MinStack obj = new MinStack();
 * obj.push(val);
 * obj.pop();
 * int param_3 = obj.top();
 * int param_4 = obj.getMin();
 */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>71. Simplify Path | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Mon, 09 Feb 2026 19:52:14 +0000</pubDate>
      <link>https://dev.to/debeshpg90/71-simplify-path-leetcode-top-interview-150-coding-questions-3bbh</link>
      <guid>https://dev.to/debeshpg90/71-simplify-path-leetcode-top-interview-150-coding-questions-3bbh</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/simplify-path/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/simplify-path/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/simplify-path/solutions/7566828/optimal-solution-beats-100-multiple-lang-lf3h" rel="noopener noreferrer"&gt;https://leetcode.com/problems/simplify-path/solutions/7566828/optimal-solution-beats-100-multiple-lang-lf3h&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomymdu39rovzyqmafwbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomymdu39rovzyqmafwbq.png" alt="leetcode 71" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public String simplifyPath(String path) {

        Stack&amp;lt;String&amp;gt; st = new Stack&amp;lt;&amp;gt;();
        String[] components = path.split("/");

        for (String component : components) {

            if (component.equals("") || component.equals(".")) {
                continue;
            }

            if (component.equals("..")) {
                if (!st.isEmpty()) {
                    st.pop();
                }
            } else {
                st.push(component);
            }
        }

        if (st.isEmpty()) {
            return "/";
        }

        StringBuilder res = new StringBuilder();
        for (String dir : st) {
            res.append("/").append(dir);
        }

        return res.toString();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>20. Valid Parentheses | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Sat, 07 Feb 2026 07:45:54 +0000</pubDate>
      <link>https://dev.to/debeshpg90/20-valid-parentheses-leetcode-top-interview-150-coding-questions-2e76</link>
      <guid>https://dev.to/debeshpg90/20-valid-parentheses-leetcode-top-interview-150-coding-questions-2e76</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/valid-parentheses/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/valid-parentheses/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/valid-parentheses/solutions/7559664/most-optimal-solution-beats-100-all-lang-32y5" rel="noopener noreferrer"&gt;https://leetcode.com/problems/valid-parentheses/solutions/7559664/most-optimal-solution-beats-100-all-lang-32y5&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr9buhr6vkna3mcnn2s0i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr9buhr6vkna3mcnn2s0i.png" alt="leetcode 20" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public boolean isValid(String s) {

        Stack&amp;lt;Character&amp;gt; stack = new Stack&amp;lt;&amp;gt;();

        for (char c : s.toCharArray()) {

            if (c == '(') {
                stack.push(')');
            } 
            else if (c == '{') {
                stack.push('}');
            } 
            else if (c == '[') {
                stack.push(']');
            } 
            else {
                if (stack.isEmpty() || stack.pop() != c) {
                    return false;
                }
            }
        }

        return stack.isEmpty();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>452. Minimum Number of Arrows to Burst Balloons | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Sat, 31 Jan 2026 21:15:45 +0000</pubDate>
      <link>https://dev.to/debeshpg90/452-minimum-number-of-arrows-to-burst-balloons-leetcode-top-interview-150-coding-questions-3di9</link>
      <guid>https://dev.to/debeshpg90/452-minimum-number-of-arrows-to-burst-balloons-leetcode-top-interview-150-coding-questions-3di9</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/solutions/7540732/most-optimal-solution-all-languages-avai-47ic" rel="noopener noreferrer"&gt;https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/solutions/7540732/most-optimal-solution-all-languages-avai-47ic&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd51c1x3kimo95h07lod5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd51c1x3kimo95h07lod5.png" alt="leetcode 452" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public int findMinArrowShots(int[][] points) {

        int n = points.length;
        if (n == 0) return 0;
        Arrays.sort(points, (a, b) -&amp;gt; Integer.compare(a[1], b[1]));

        int arrows = 1;
        int end = points[0][1];

        for (int i = 1; i &amp;lt; n; i++) {
            if (points[i][0] &amp;gt; end) {
                arrows++;
                end = points[i][1];
            }
        }

        return arrows;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>57. Insert Interval | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Fri, 23 Jan 2026 17:36:23 +0000</pubDate>
      <link>https://dev.to/debeshpg90/57-insert-interval-leetcode-top-interview-150-coding-questions-34of</link>
      <guid>https://dev.to/debeshpg90/57-insert-interval-leetcode-top-interview-150-coding-questions-34of</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/insert-interval/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/insert-interval/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/insert-interval/solutions/7518330/most-optimal-solution-all-languages-beat-jp9b" rel="noopener noreferrer"&gt;https://leetcode.com/problems/insert-interval/solutions/7518330/most-optimal-solution-all-languages-beat-jp9b&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbaiqaisyb1zscoyyoulu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbaiqaisyb1zscoyyoulu.png" alt="leetcode 57" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public int[][] insert(int[][] intervals, int[] newInterval) {

        List&amp;lt;int[]&amp;gt; res = new ArrayList&amp;lt;&amp;gt;();
        int i = 0;

        while (i &amp;lt; intervals.length &amp;amp;&amp;amp; intervals[i][1] &amp;lt; newInterval[0]) {
            res.add(intervals[i]);
            i++;
        }

        while (i &amp;lt; intervals.length &amp;amp;&amp;amp; intervals[i][0] &amp;lt;= newInterval[1]) {
            newInterval[0] = Math.min(newInterval[0], intervals[i][0]);
            newInterval[1] = Math.max(newInterval[1], intervals[i][1]);
            i++;
        }
        res.add(newInterval);

        while (i &amp;lt; intervals.length) {
            res.add(intervals[i]);
            i++;
        }

        return res.toArray(new int[res.size()][]);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>56. Merge Intervals | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Wed, 21 Jan 2026 18:03:10 +0000</pubDate>
      <link>https://dev.to/debeshpg90/56-merge-intervals-leetcode-top-interview-150-coding-questions-3oa0</link>
      <guid>https://dev.to/debeshpg90/56-merge-intervals-leetcode-top-interview-150-coding-questions-3oa0</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/merge-intervals/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/merge-intervals/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/merge-intervals/solutions/7513395/most-optimal-solution-beats-200-all-lang-wtea" rel="noopener noreferrer"&gt;https://leetcode.com/problems/merge-intervals/solutions/7513395/most-optimal-solution-beats-200-all-lang-wtea&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvpstfvsa9i0fi22z1s7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvpstfvsa9i0fi22z1s7.png" alt="leetcode 56" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public int[][] merge(int[][] intervals) {

        if (intervals.length &amp;lt;= 1) {
            return intervals;
        }

        Arrays.sort(intervals, Comparator.comparingInt(i -&amp;gt; i[0]));

        List&amp;lt;int[]&amp;gt; res = new ArrayList&amp;lt;&amp;gt;();

        int[] current = intervals[0];
        res.add(current);

        for (int[] interval : intervals) {
            if (current[1] &amp;gt;= interval[0]) {
                current[1] = Math.max(current[1], interval[1]);
            } else {
                current = interval;
                res.add(current);
            }
        }

        return res.toArray(new int[res.size()][]);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>228. Summary Ranges | LeetCode | Top Interview 150 | Coding Questions</title>
      <dc:creator>Debesh P.</dc:creator>
      <pubDate>Tue, 20 Jan 2026 18:20:32 +0000</pubDate>
      <link>https://dev.to/debeshpg90/228-summary-ranges-leetcode-top-interview-150-coding-questions-11lf</link>
      <guid>https://dev.to/debeshpg90/228-summary-ranges-leetcode-top-interview-150-coding-questions-11lf</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Problem Link
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/summary-ranges/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/summary-ranges/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Detailed Step-by-Step Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://leetcode.com/problems/summary-ranges/solutions/7510743/most-optimal-solution-beats-200-on-o1-in-5huw" rel="noopener noreferrer"&gt;https://leetcode.com/problems/summary-ranges/solutions/7510743/most-optimal-solution-beats-200-on-o1-in-5huw&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fns7be35p2t8umy1f5ng7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fns7be35p2t8umy1f5ng7.png" alt="leetcode 228" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public List&amp;lt;String&amp;gt; summaryRanges(int[] nums) {

        List&amp;lt;String&amp;gt; res = new ArrayList&amp;lt;&amp;gt;();
        int n = nums.length;

        for (int i = 0; i &amp;lt; n; i++) {
            int start = nums[i];

            while (i + 1 &amp;lt; n &amp;amp;&amp;amp; nums[i + 1] - nums[i] == 1) {
                i++;
            }

            if (start == nums[i]) {
                res.add(String.valueOf(start));
            } else {
                res.add(start + "-&amp;gt;" + nums[i]);
            }
        }

        return res;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
