<?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 Dummy Skiller on Medium]]></title>
        <description><![CDATA[Stories by Dummy Skiller on Medium]]></description>
        <link>https://medium.com/@skillerdummy?source=rss-5229c2e7852a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pJWkb-JVMJ0ql-e9Sqc06A.png</url>
            <title>Stories by Dummy Skiller on Medium</title>
            <link>https://medium.com/@skillerdummy?source=rss-5229c2e7852a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 29 May 2026 17:55:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@skillerdummy/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[Java: Search in Rotated Sorted Array]]></title>
            <link>https://medium.com/@skillerdummy/java-search-in-rotated-sorted-array-001188002f14?source=rss-5229c2e7852a------2</link>
            <guid isPermaLink="false">https://medium.com/p/001188002f14</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[rotated-sorted-array]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Dummy Skiller]]></dc:creator>
            <pubDate>Wed, 22 May 2024 03:38:47 GMT</pubDate>
            <atom:updated>2024-05-22T03:38:47.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuU8ZHuerrq0SsbzRF0-Yw.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><h3>Searching in a Rotated Sorted Array in Java: Simplified Approaches</h3><p>Today, we discuss an essential method for searching: Binary Search. Learn how this efficient algorithm shortens runtime and works seamlessly on any array, especially in rotated sorted arrays. Perfect for your DSA practice and coding interview preparation, this guide will enhance your algorithmic skills.</p><h4><strong>Understanding Rotated Sorted Arrays</strong></h4><p>Before diving into the solutions, it’s important to understand what a rotated sorted array looks like. The array is sorted but has been “rotated” at a certain pivot, meaning that the order is disrupted at one point and continues sequentially.</p><p><strong>For instance:</strong></p><ul><li>Sorted Array: [1, 2, 3, 4, 5, 6, 7]</li><li>Rotated Array: [4, 5, 6, 7, 1, 2, 3]</li></ul><p><strong>Binary Search Approach:</strong> When to Use Binary Search</p><p>Binary search is more efficient with a time complexity of O(log n), making it suitable for larger arrays. It leverages the sorted nature of the array and the rotation property to find the target efficiently.</p><p><strong>Steps for Binary Search</strong></p><blockquote>Identify the mid-point of the current subarray.</blockquote><blockquote>Determine which part (left or right) of the array is normally ordered.</blockquote><blockquote>Check if the target lies within the normally ordered part.</blockquote><blockquote>Adjust the search range to the normally ordered part or the other part based on the target’s position.</blockquote><p><strong>Full Code:</strong></p><pre>public class BinarySearch {<br><br>    public static int search(int[] nums, int target) {<br><br>    int left = 0, right = nums.length - 1;<br><br>    while (left &lt;= right) {<br><br>        int mid = left + (right - left) / 2;<br><br>        if (nums[mid] == target) {<br><br>            return mid;<br><br>        }<br><br>        // Determine which side is normally ordered<br><br>        if (nums[left] &lt;= nums[mid]) {<br><br>            // Left side is normally ordered<br><br>            if (nums[left] &lt;= target &amp;&amp; target &lt; nums[mid]) {<br><br>                right = mid - 1;<br><br>            } else {<br><br>                left = mid + 1;<br><br>            }<br><br>        } else {<br><br>            // Right side is normally ordered<br><br>            if (nums[mid] &lt; target &amp;&amp; target &lt;= nums[right]) {<br><br>                left = mid + 1;<br><br>            } else {<br><br>                right = mid - 1;<br><br>            }<br><br>        }<br><br>    }<br><br>    return -1; // Target not found<br><br>}<br><br>    public static void main(String[] args) {<br><br>        int[] nums = {4, 5, 6, 7, 0, 1, 2};<br><br>        int target = 0;<br><br>        int result = search(nums, target);<br><br>        System.out.println(&quot;Index of target is: &quot; + result);<br><br>    }<br><br>}</pre><blockquote>For Proper Step-by-Step with code snippet explanation you can <a href="https://www.dummyskiller.in/search-in-rotated-sorted-array-easy-dsa-method"><strong>click here</strong></a>.</blockquote><p><strong>You can Check Out:</strong></p><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-reverse-a-linked-list-step-by-step-guide-with-examples">How to reverse Linked List using Java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-remove-special-characters-from-a-string">How to remove special character from string using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-find-missing-no-in-array">How to find missing number in an array using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/easy-way-how-to-find-middle-element-of-linked-list-in-java">How to find middle term of a Linked List in java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-find-equilibrium-point-in-array">How to find equilibrium point in array using java</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=001188002f14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: How to Find Middle Element in Linked List]]></title>
            <link>https://medium.com/@skillerdummy/java-how-to-find-middle-element-in-linked-list-b60c9f2718d7?source=rss-5229c2e7852a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b60c9f2718d7</guid>
            <category><![CDATA[middle]]></category>
            <category><![CDATA[elements]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[linked-lists]]></category>
            <dc:creator><![CDATA[Dummy Skiller]]></dc:creator>
            <pubDate>Sat, 18 May 2024 15:01:26 GMT</pubDate>
            <atom:updated>2024-05-18T15:01:26.372Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to Find Middle Element in Linked List in java" src="https://cdn-images-1.medium.com/max/1024/1*JuU8ZHuerrq0SsbzRF0-Yw.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><h3>Introduction</h3><p>In this tutorial, we’ll explore a straightforward method to find the middle element of a linked list using Java. Linked lists are fundamental data structures in programming, and understanding how to efficiently navigate them is essential for any Java developer. By the end of this tutorial, you’ll grasp a simple yet effective approach to locate the middle element of a linked list with ease.</p><h4><strong>Approach</strong></h4><ul><li>We’ll start by defining a Node class to represent individual elements of the linked list.</li><li>Next, we’ll implement a method to add elements to the linked list.</li><li>Then, we’ll devise a strategy to find the middle element of the linked list.</li><li>Finally, we’ll demonstrate the approach with a simple Java program.</li></ul><figure><img alt="Easy Way: How to find middle element of linked list in java" src="https://cdn-images-1.medium.com/max/1024/1*I5kgPhBWBRLpssgDZPZsIQ.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><p><strong>Explanation:-</strong></p><blockquote>We start with both the slowPointer and fastPointer pointing to the head of the linked list.</blockquote><blockquote>The slowPointer moves one step forward (<strong>slowPointer = slowPointer.next</strong>) at each iteration.</blockquote><blockquote>The fastPointer moves two steps forward (<strong>fastPointer = fastPointer.next.next</strong>) at each iteration.</blockquote><blockquote>When the fastPointer reaches the end of the list, the slowPointer will be at the middle element.</blockquote><p><strong>Step 1</strong>: Define the Node Class</p><pre>class Node {<br>    int data;<br><br>    Node next;<br><br>    Node(int data) {<br><br>        this.data = data;<br><br>        this.next = null;<br><br>    }<br><br>}</pre><p><strong>Step 2</strong>: Add Elements to the Linked List</p><pre>class LinkedList {<br><br>    Node head;<br><br>    void add(int data) {<br><br>        Node newNode = new Node(data);<br><br>        if (head == null) {<br><br>            head = newNode;<br><br>            return;<br><br>    }<br><br>    Node current = head;<br><br>    while (current.next != null) {<br><br>        current = current.next;<br><br>        }<br><br>    current.next = newNode;<br><br>    }</pre><p><strong>Step 3</strong>: Find the Middle Element</p><pre>Node findMiddle() {<br><br>        Node slowPointer = head;<br><br>        Node fastPointer = head;<br><br>        while (fastPointer != null &amp;&amp; fastPointer.next != null) {<br><br>            slowPointer = slowPointer.next;<br><br>            fastPointer = fastPointer.next.next;<br><br>        }<br><br>        return slowPointer;<br><br>    }<br><br>}</pre><blockquote>For Line-by-Line and Full Code View explanation you can <a href="https://www.dummyskiller.in/easy-way-how-to-find-middle-element-of-linked-list-in-java"><strong>clear here</strong></a>.</blockquote><p><strong>You can Check Out:</strong></p><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-reverse-a-linked-list-step-by-step-guide-with-examples">How to reverse Linked List using Java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-remove-special-characters-from-a-string">How to remove special character from string using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-find-missing-no-in-array">How to find missing number in an array using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/finding-and-printing-duplicate-elements-between-two-arrays-in-java">How to find common elements in given arrays using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-find-equilibrium-point-in-array">How to find equilibrium point in array using java</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b60c9f2718d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: How to Find Missing Number in Array]]></title>
            <link>https://medium.com/@skillerdummy/java-how-to-find-missing-number-in-array-c858c7cc2d2f?source=rss-5229c2e7852a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c858c7cc2d2f</guid>
            <category><![CDATA[numbers]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[missing]]></category>
            <dc:creator><![CDATA[Dummy Skiller]]></dc:creator>
            <pubDate>Wed, 15 May 2024 18:07:11 GMT</pubDate>
            <atom:updated>2024-05-15T18:10:31.859Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to find Missing number in array in java" src="https://cdn-images-1.medium.com/max/1024/1*JuU8ZHuerrq0SsbzRF0-Yw.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>In this tutorial, we’ll learn how to write a straightforward Java program to find a missing number in an array. We’ll break down the process step by step, making it easy for anyone, even a beginner, to understand.</p><h4><strong>Approach</strong></h4><p>To find the missing number in an array, we’ll compare the sum of all elements in the array with the sum of expected elements (assuming the array is sequential). The difference between these two sums will give us the missing number.</p><p><strong>Java Code:</strong></p><pre>class Main {<br><br>    public static void main(String[] args) {<br><br>    // Define the array<br><br>    int[] a = {1,2,3,4,5,6,7,9,10};<br><br>    // Initialize variables to store sums<br><br>    int ac_sum = 0;<br><br>    int ex_sum = 0;<br><br>    // Calculate the sum of actual elements in the array<br><br>    for(int i = 0; i &lt; a.length; i++) {<br><br>        ac_sum += a[i];<br><br>    }<br><br>    // Calculate the sum of expected elements<br><br>    for(int i = 1; i &lt;= a[a.length - 1]; i++) {<br><br>        ex_sum += i;<br><br>    }<br><br>    // Find the missing number<br><br>    int missing = ex_sum - ac_sum;<br><br>    // Print the missing number<br><br>    System.out.println(&quot;Missing No. is &quot; + missing);<br><br>    }<br><br>}</pre><h4>Code Explained:</h4><pre>class Main{</pre><ul><li>This line declares a class named &quot;Main&quot;. In Java, every application begins with a class definition, and the class containing the main method must have the same name as the file where it&#39;s declared.</li></ul><pre>public static void main(String[] args) {</pre><ul><li>This line declares the main method, which is the entry point of the Java program. It&#39;s a special method that serves as the starting point for execution. It takes an array of strings (args) as a parameter, which can be used to pass command-line arguments to the program.</li></ul><pre>// Define the array</pre><ul><li>This is a comment indicating that the following line initializes an array.</li></ul><pre>int[] a = {1,2,3,4,5,6,7,9,10};</pre><ul><li>This line declares and initializes an integer array named &quot;a&quot; with the values {1,2,3,4,5,6,7,9,10}.</li></ul><pre>// Initialize variables to store sums</pre><ul><li>This is a comment indicating that the following lines declare variables to store sums.</li></ul><pre>int ac_sum = 0;<br>int ex_sum = 0;</pre><ul><li>These lines declare two integer variables named &quot;ac_sum&quot; and &quot;ex_sum&quot; and initialize them both to 0.</li></ul><pre>// Calculate the sum of actual elements in the array</pre><ul><li>This is a comment indicating that the following loop calculates the sum of the elements in the array &quot;a&quot;.</li></ul><pre>for(int i = 0; i &lt; a.length; i++) {<br>        ac_sum += a[i];<br>    }</pre><ul><li>This loop iterates over each element of the array &quot;a&quot; using the variable &quot;i&quot; as the index. It adds each element to the variable &quot;ac_sum&quot;, effectively calculating the sum of all elements in the array.</li></ul><pre>// Calculate the sum of expected elements</pre><ul><li>This is a comment indicating that the following loop calculates the sum of expected elements based on the length of the array &quot;a&quot;.</li></ul><pre>for(int i = 1; i &lt;= a[a.length - 1]; i++) {<br>        ex_sum += i;<br>    }</pre><ul><li>This loop iterates from 1 to the value of the last element in the array &quot;a&quot;. It adds each value of &quot;i&quot; to the variable &quot;ex_sum&quot;, effectively calculating the sum of all integers from 1 to the value of the last element in the array.</li></ul><pre>// Find the missing number</pre><ul><li>This is a comment indicating that the following line calculates the missing number.</li></ul><pre>int missing = ex_sum - ac_sum;</pre><ul><li>This line calculates the missing number by subtracting the sum of actual elements in the array from the sum of expected elements.</li></ul><pre>// Print the missing number</pre><ul><li>This is a comment indicating that the following line prints the missing number.</li></ul><pre>System.out.println(&quot;Missing No. is &quot; + missing);</pre><ul><li>This line prints the missing number to the console along with the text &quot;Missing No. is &quot;. The missing number is concatenated with the string using the &#39;+&#39; operator, and the result is printed to the console.</li></ul><pre>}<br>}</pre><ul><li>These lines close the main method and the class definition.</li></ul><p><strong>You can Check Out:</strong></p><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-remove-special-characters-from-a-string">How to remove special character from string using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/understanding-a-java-code-to-check-for-palindrome">How to check whether a given number or string is palindrome or not using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/finding-and-printing-duplicate-elements-between-two-arrays-in-java">How to find common elements in given arrays using java</a></blockquote><blockquote><a href="https://www.dummyskiller.in/java-tutorial-how-to-find-equilibrium-point-in-array">How to find equilibrium point in array using java</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c858c7cc2d2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: How to Reverse Linked List]]></title>
            <link>https://medium.com/@skillerdummy/java-how-to-reverse-linked-list-ffeaee2a13e3?source=rss-5229c2e7852a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffeaee2a13e3</guid>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[linked-lists]]></category>
            <category><![CDATA[reverse-linked-list]]></category>
            <category><![CDATA[easy]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Dummy Skiller]]></dc:creator>
            <pubDate>Wed, 15 May 2024 17:29:25 GMT</pubDate>
            <atom:updated>2024-05-15T17:29:25.151Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to reverse a linked list using java easy way" src="https://cdn-images-1.medium.com/max/1024/1*JuU8ZHuerrq0SsbzRF0-Yw.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>In Java programming, reversing a linked list is a fundamental operation often encountered in coding interviews and real-world applications. Understanding how to reverse a linked list efficiently is essential for mastering data structures and algorithms. In this tutorial, we will explore various approaches to reverse a linked list in Java, accompanied by clear explanations and illustrative examples.</p><h4>Understanding Linked Lists</h4><p>Before diving into the reversal process, let’s briefly review what linked lists are in Java. A linked list is a data structure consisting of a sequence of elements, where each element points to the next one in the sequence via a pointer or reference.</p><figure><img alt="How to reverse Linked List using Java" src="https://cdn-images-1.medium.com/max/1024/1*H1qLaaaHqnaOmw8D_3YjUQ.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><p><strong>Reversing a Linked List: Iterative Approach</strong></p><p>The iterative approach involves traversing the linked list from the beginning to the end, changing the pointers or references of each node to reverse the direction of the list.</p><p><strong>Algorithm:</strong></p><ol><li><em>Initialize three pointers: current, previous, and next.</em></li><li><em>Iterate through the list, updating pointers accordingly.</em></li><li><em>Set the head of the list to the previous pointer, which will now be pointing to the last node.</em></li></ol><p><strong>Implementation:</strong></p><pre>public ListNode reverseList(ListNode head) {<br><br>    ListNode prev = null;<br><br>    ListNode curr = head;<br><br>    while (curr != null) {<br><br>        ListNode nextTemp = curr.next;<br><br>        curr.next = prev;<br><br>        prev = curr;<br><br>        curr = nextTemp;<br><br>    }<br><br>    return prev;<br><br>}</pre><figure><img alt="Reverse Linked List: Iterative Approach" src="https://cdn-images-1.medium.com/max/1024/1*PYyNzM60SXH6l7ipt2ofqA.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><p><strong>Reversing a Linked List: Recursive Approach</strong></p><p>The recursive approach involves reversing smaller sublists recursively until the entire list is reversed.</p><p><strong>Algorithm:</strong></p><ol><li><em>Base case: If the list is empty or has only one node, return it.</em></li><li><em>Recursively reverse the sublist starting from the second node.</em></li><li><em>Adjust the pointers to reverse the list.</em></li></ol><p><strong>Implementation:</strong></p><pre>public ListNode reverseList(ListNode head) {<br><br>    if (head == null || head.next == null) {<br><br>        return head;<br><br>    }<br><br>    ListNode reversed = reverseList(head.next);<br><br>    head.next.next = head;<br><br>    head.next = null;<br><br>    return reversed;<br><br>}</pre><figure><img alt="Reverse Linked List: Recursive Approach" src="https://cdn-images-1.medium.com/max/1024/1*YVLJJAI2IQwaKoGDIeR_LQ.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><blockquote>For a comprehensive line-by-line &amp; full code view explanation of the above code, please <a href="https://www.dummyskiller.in/java-tutorial-how-to-reverse-a-linked-list-step-by-step-guide-with-examples"><strong>click here</strong></a>.</blockquote><h4>Conclusion</h4><p>Reversing a linked list is a common problem in Java programming, and understanding the various approaches is crucial for enhancing your coding skills. In this tutorial, we discussed both iterative and recursive methods for reversing a linked list, along with their implementations and example usage.</p><p>By following this comprehensive guide, you should now have a solid understanding of how to reverse a linked list in Java and be well-equipped to tackle similar challenges in your programming journey. requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffeaee2a13e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python: How to Find Longest Substring without Repeating Characters]]></title>
            <link>https://medium.com/@skillerdummy/python-how-to-find-longest-substring-without-repeating-characters-281941f14727?source=rss-5229c2e7852a------2</link>
            <guid isPermaLink="false">https://medium.com/p/281941f14727</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[sliding-window-approach]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Dummy Skiller]]></dc:creator>
            <pubDate>Tue, 14 May 2024 08:50:08 GMT</pubDate>
            <atom:updated>2024-05-14T08:55:40.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to Find longest substring without repeating character in python" src="https://cdn-images-1.medium.com/max/1024/1*9pSi8gVhA_QbDeG_-vWquA.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><h4><strong>Introduction</strong></h4><p>In this tutorial, we’ll explore an easy and efficient solution to the “Longest Substring Without Repeating Characters” problem using Python. This problem requires finding the length of the longest substring without repeating characters in a given string.</p><h4><strong>Easy Approach</strong></h4><p>We’ll solve this problem using a sliding window technique, which involves maintaining a window of characters and adjusting its size as we traverse the string.</p><figure><img alt="Sliding Window Technique: To Find Longest Substring Without Repeating Characters" src="https://cdn-images-1.medium.com/max/1024/1*Wl4bBtOCKkcVhVEcTCEh-A.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><p><strong><em>Full Code:</em></strong></p><pre>def length_of_longest_substring(s: str) -&gt; int:<br><br>    # Dictionary to store the index of each character<br><br>    char_index_map = {}<br><br>    # Initialize pointers and max_length<br><br>    start = 0<br><br>    max_length = 0<br><br>    # Traverse the string<br><br>    for end in range(len(s)):<br><br>        # If the current character is already in the substring<br><br>        # and its index is greater than or equal to the start pointer,<br><br>        # update the start pointer to the next index of the repeated character<br><br>        if s[end] in char_index_map and char_index_map[s[end]] &gt;= start:<br><br>            start = char_index_map[s[end]] + 1<br><br>        # Update the index of the current character in the dictionary<br><br>        char_index_map[s[end]] = end<br><br>        # Update max_length if a longer substring without repeating characters is found<br><br>        max_length = max(max_length, end - start + 1)<br><br>    # Return the length of the longest substring without repeating characters<br><br>    return max_length<br><br># Test the function<br><br>print(length_of_longest_substring(&quot;abcabcbb&quot;))<br><br># Output: 3</pre><blockquote>For a comprehensive line-by-line explanation of the above code, please <a href="https://www.dummyskiller.in/efficient-python-solution-how-to-find-longest-substring-without-repeating-characters"><strong>click here</strong>.</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=281941f14727" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: How to Find Equilibrium Point in Array]]></title>
            <link>https://medium.com/@skillerdummy/java-how-to-find-equilibrium-point-in-array-d615b63b7e9c?source=rss-5229c2e7852a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d615b63b7e9c</guid>
            <category><![CDATA[java-tutorial]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[equilibrium]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Dummy Skiller]]></dc:creator>
            <pubDate>Sat, 11 May 2024 13:08:11 GMT</pubDate>
            <atom:updated>2024-05-14T08:50:50.749Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Java Tutorial: How to Find Equilibrium in Array" src="https://cdn-images-1.medium.com/max/1024/1*JuU8ZHuerrq0SsbzRF0-Yw.png" /><figcaption>By <a href="https://www.dummyskiller.in/">Dummy Skiller</a></figcaption></figure><h4><strong>What is an Equilibrium Point in an Array ?</strong></h4><p>Equilibrium point, also known as balance point, in an array is the index where the sum of elements to the left of that index is equal to the sum of elements to the right.</p><p><strong>Java Program to Find Equilibrium Point:</strong></p><pre>public class EquilibriumPointFinder {<br><br>    public static int findEquilibriumPoint(int[] arr) {<br><br>        int totalSum = 0;<br><br>        int leftSum = 0;<br><br>        // Calculating the total sum of the array<br><br>        for (int num : arr) {<br><br>            totalSum += num;<br><br>        }<br><br>        // Iterating through the array to find the equilibrium point<br><br>        for (int i = 0; i &lt; arr.length; i++) {<br><br>            totalSum -= arr[i]; // Subtract current element from total sum<br><br>            if (leftSum == totalSum) {<br><br>                return i; // Return index if equilibrium point found<br><br>            }<br><br>            leftSum += arr[i]; // Add current element to left sum<br><br>    }<br><br>        return -1; // Return -1 if no equilibrium point found<br><br>}<br><br>public static void main(String[] args) {<br><br>    int[] array = {1, 4, 5, 2, 3};<br><br>    int equilibriumIndex = findEquilibriumPoint(array);<br><br>    if (equilibriumIndex != -1) {<br><br>        System.out.println(&quot;Equilibrium point found at index: &quot; + equilibriumIndex);<br><br>    } else {<br><br>        System.out.println(&quot;No equilibrium point found in the array.&quot;);<br><br>        }<br><br>    }<br><br>}</pre><blockquote>For a comprehensive line-by-line explanation of the above code, please <a href="https://www.dummyskiller.in/java-tutorial-how-to-find-equilibrium-point-in-array"><strong>click here</strong></a>.</blockquote><h4><strong>Conclusion</strong></h4><p>Understanding equilibrium points in arrays is crucial for efficient algorithm design. With the provided Java program and explanations, you can now easily identify equilibrium points within an array, enabling you to tackle various array-related problems effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d615b63b7e9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>