<?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: SURENDAR K S</title>
    <description>The latest articles on DEV Community by SURENDAR K S (@surendar_sk).</description>
    <link>https://dev.to/surendar_sk</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%2F2416822%2F3e484976-35a8-4094-975b-19c68033191c.jpeg</url>
      <title>DEV Community: SURENDAR K S</title>
      <link>https://dev.to/surendar_sk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/surendar_sk"/>
    <language>en</language>
    <item>
      <title>DSA Patterns you need to know !!!</title>
      <dc:creator>SURENDAR K S</dc:creator>
      <pubDate>Wed, 05 Mar 2025 14:44:26 +0000</pubDate>
      <link>https://dev.to/surendar_sk/dsa-patterns-you-need-to-know--3k93</link>
      <guid>https://dev.to/surendar_sk/dsa-patterns-you-need-to-know--3k93</guid>
      <description>&lt;p&gt;After solving many DSA problems, I've noticed some key patterns that are important for coding interviews.&lt;br&gt;&lt;br&gt;
At the end of this article, I have also included links to some of the best LeetCode articles that I found helpful for better understanding.  &lt;/p&gt;




&lt;h2&gt;
  
  
  1. Fast and Slow Pointer
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: This technique uses two pointers moving at different speeds to solve problems involving cycles, such as finding the middle of a list, detecting loops, or checking for palindromes.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/linked-list-cycle-ii/" rel="noopener noreferrer"&gt;Linked List Cycle II&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/remove-nth-node-from-end-of-list/" rel="noopener noreferrer"&gt;Remove nth Node from the End of List&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/find-the-duplicate-number/" rel="noopener noreferrer"&gt;Find the Duplicate Number&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/palindrome-linked-list/" rel="noopener noreferrer"&gt;Palindrome Linked List&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Overlapping Intervals
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Intervals are often manipulated through sorting and merging based on their start and end times.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/merge-intervals/" rel="noopener noreferrer"&gt;Merge Intervals&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/insert-interval/" rel="noopener noreferrer"&gt;Insert Interval&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/my-calendar-ii/" rel="noopener noreferrer"&gt;My Calendar II&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/" rel="noopener noreferrer"&gt;Minimum Number of Arrows to Burst Balloons&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/non-overlapping-intervals/" rel="noopener noreferrer"&gt;Non-overlapping Intervals&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Prefix Sum
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Prefix Sums/Products are techniques that store cumulative sums or products up to each index, allowing for quick subarray range queries.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/find-the-middle-index-in-array/" rel="noopener noreferrer"&gt;Find the Middle Index in Array&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/product-of-array-except-self/" rel="noopener noreferrer"&gt;Product of Array Except Self&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/maximum-product-subarray/" rel="noopener noreferrer"&gt;Maximum Product Subarray&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/number-of-ways-to-split-array/" rel="noopener noreferrer"&gt;Number of Ways to Split Array&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/range-sum-query-2d-immutable/" rel="noopener noreferrer"&gt;Range Sum Query 2D&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Sliding Window
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: A sliding window is a subarray or substring that moves over data to solve problems efficiently in linear time.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Fixed Size
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/maximum-subarray/" rel="noopener noreferrer"&gt;Maximum Sum Subarray of Size K&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/number-of-sub-arrays-with-odd-sum/" rel="noopener noreferrer"&gt;Number of Subarrays Having Average Greater or Equal to Threshold&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/repeated-dna-sequences/" rel="noopener noreferrer"&gt;Repeated DNA Sequences&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/permutation-in-string/" rel="noopener noreferrer"&gt;Permutation in String&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/sliding-subarray-beauty/" rel="noopener noreferrer"&gt;Sliding Subarray Beauty&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/sliding-window-maximum/" rel="noopener noreferrer"&gt;Sliding Window Maximum&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Variable Size
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/longest-substring-without-repeating-characters/" rel="noopener noreferrer"&gt;Longest Substring Without Repeating Characters&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/minimum-size-subarray-sum/" rel="noopener noreferrer"&gt;Minimum Size Subarray Sum&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/subarray-product-less-than-k/" rel="noopener noreferrer"&gt;Subarray Product Less Than K&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/max-consecutive-ones/" rel="noopener noreferrer"&gt;Max Consecutive Ones&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/fruit-into-baskets/" rel="noopener noreferrer"&gt;Fruits Into Baskets&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/count-number-of-nice-subarrays/" rel="noopener noreferrer"&gt;Count Number of Nice Subarrays&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/minimum-window-substring/" rel="noopener noreferrer"&gt;Minimum Window Substring&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Two Pointers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: The two pointers technique involves having two different indices move through the input at different speeds to solve various array or linked list problems.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/" rel="noopener noreferrer"&gt;Two Sum II - Input Array is Sorted&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/sort-colors/" rel="noopener noreferrer"&gt;Dutch National Flag: Sort Colors&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/next-permutation/" rel="noopener noreferrer"&gt;Next Permutation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/bag-of-tokens/" rel="noopener noreferrer"&gt;Bag of Tokens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/container-with-most-water/" rel="noopener noreferrer"&gt;Container With Most Water&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/trapping-rain-water/" rel="noopener noreferrer"&gt;Trapping Rain Water&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Cyclic Sort (Index-Based)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Cyclic sort is an efficient approach to solving problems where numbers are consecutively ordered and must be placed in the correct index.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/missing-number/" rel="noopener noreferrer"&gt;Missing Number&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/" rel="noopener noreferrer"&gt;Find Missing Numbers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/set-mismatch/" rel="noopener noreferrer"&gt;Set Mismatch&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/first-missing-positive/" rel="noopener noreferrer"&gt;First Missing Positive&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. Reversal of Linked List (In-place)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Reversing a linked list in place without using extra space is key for problems that require in-place list manipulations.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/reverse-linked-list/" rel="noopener noreferrer"&gt;Reverse Linked List&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/reverse-nodes-in-k-group/" rel="noopener noreferrer"&gt;Reverse Nodes in k-Group&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/swap-nodes-in-pairs/" rel="noopener noreferrer"&gt;Swap Nodes in Pairs&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8. Matrix Manipulation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Problems involving 2D arrays (matrices) are often solved using row-column traversal or manipulation based on matrix properties.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/rotate-image/" rel="noopener noreferrer"&gt;Rotate Image&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/spiral-matrix/" rel="noopener noreferrer"&gt;Spiral Matrix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/set-matrix-zeroes/" rel="noopener noreferrer"&gt;Set Matrix Zeroes&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/game-of-life/" rel="noopener noreferrer"&gt;Game of Life&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;







&lt;h2&gt;
  
  
  9. Merge Intervals
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Problems that involve merging overlapping intervals require sorting the intervals first and then merging them based on conditions.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/merge-intervals/" rel="noopener noreferrer"&gt;Merge Intervals&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/interval-list-intersections/" rel="noopener noreferrer"&gt;Interval List Intersections&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/meeting-rooms-ii/" rel="noopener noreferrer"&gt;Meeting Rooms II&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/" rel="noopener noreferrer"&gt;Minimum Number of Arrows to Burst Balloons&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  10. Bit Manipulation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Bitwise operations are useful for solving problems that involve binary representation, toggling bits, and checking for power-of-two numbers.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/single-number/" rel="noopener noreferrer"&gt;Single Number&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/number-of-1-bits/" rel="noopener noreferrer"&gt;Number of 1 Bits&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/power-of-two/" rel="noopener noreferrer"&gt;Power of Two&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/counting-bits/" rel="noopener noreferrer"&gt;Counting Bits&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  11. Backtracking
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Backtracking is used to explore all possible solutions by trying out different possibilities and undoing incorrect choices.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/generate-parentheses/" rel="noopener noreferrer"&gt;Generate Parentheses&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/permutations/" rel="noopener noreferrer"&gt;Permutations&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/combination-sum/" rel="noopener noreferrer"&gt;Combination Sum&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/sudoku-solver/" rel="noopener noreferrer"&gt;Sudoku Solver&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  12. Dynamic Programming
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: DP problems involve breaking problems into smaller subproblems and using memoization or tabulation to store computed values.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/climbing-stairs/" rel="noopener noreferrer"&gt;Climbing Stairs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/house-robber/" rel="noopener noreferrer"&gt;House Robber&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/longest-palindromic-substring/" rel="noopener noreferrer"&gt;Longest Palindromic Substring&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/longest-common-subsequence/" rel="noopener noreferrer"&gt;Longest Common Subsequence&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  13. Greedy Algorithms
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: The greedy approach involves making the best choice at each step to find the global optimum.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/jump-game/" rel="noopener noreferrer"&gt;Jump Game&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/gas-station/" rel="noopener noreferrer"&gt;Gas Station&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/assign-cookies/" rel="noopener noreferrer"&gt;Assign Cookies&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/partition-labels/" rel="noopener noreferrer"&gt;Partition Labels&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  14. Graphs (BFS &amp;amp; DFS)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Graph traversal techniques like Breadth-First Search (BFS) and Depth-First Search (DFS) are widely used in problems involving paths, cycles, and connectivity.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/number-of-islands/" rel="noopener noreferrer"&gt;Number of Islands&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/course-schedule/" rel="noopener noreferrer"&gt;Course Schedule&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/word-ladder/" rel="noopener noreferrer"&gt;Word Ladder&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/surrounded-regions/" rel="noopener noreferrer"&gt;Surrounded Regions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  15. Topological Sorting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Used for scheduling tasks or finding dependency orders in Directed Acyclic Graphs (DAGs).  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/course-schedule-ii/" rel="noopener noreferrer"&gt;Course Schedule II&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/alien-dictionary/" rel="noopener noreferrer"&gt;Alien Dictionary&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/find-eventual-safe-states/" rel="noopener noreferrer"&gt;Find Eventual Safe States&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  16. Trie (Prefix Tree)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: A Trie is a tree-like data structure used for fast searching of prefixes in words.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/implement-trie-prefix-tree/" rel="noopener noreferrer"&gt;Implement Trie (Prefix Tree)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/word-search-ii/" rel="noopener noreferrer"&gt;Word Search II&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/replace-words/" rel="noopener noreferrer"&gt;Replace Words&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  17. Heap (Priority Queue)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Min-heaps and max-heaps are used to efficiently get the smallest/largest elements in a dataset.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/kth-largest-element-in-an-array/" rel="noopener noreferrer"&gt;Kth Largest Element in an Array&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/top-k-frequent-elements/" rel="noopener noreferrer"&gt;Top K Frequent Elements&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/find-median-from-data-stream/" rel="noopener noreferrer"&gt;Find Median from Data Stream&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/task-scheduler/" rel="noopener noreferrer"&gt;Task Scheduler&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  18. Union-Find (Disjoint Set)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: The Union-Find data structure helps in solving problems related to connectivity and cycles in graphs.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/graph-valid-tree/" rel="noopener noreferrer"&gt;Graph Valid Tree&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/redundant-connection/" rel="noopener noreferrer"&gt;Redundant Connection&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/" rel="noopener noreferrer"&gt;Number of Connected Components in an Undirected Graph&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  19. Monotonic Stack
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: A stack where elements are pushed or popped based on increasing or decreasing order constraints.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/next-greater-element-i/" rel="noopener noreferrer"&gt;Next Greater Element I&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/largest-rectangle-in-histogram/" rel="noopener noreferrer"&gt;Largest Rectangle in Histogram&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/daily-temperatures/" rel="noopener noreferrer"&gt;Daily Temperatures&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/problems/trapping-rain-water/" rel="noopener noreferrer"&gt;Trapping Rain Water&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These patterns are fundamental for solving a variety of DSA problems efficiently. If you understand these well, you'll be well-prepared for coding interviews! 🚀  &lt;/p&gt;

&lt;p&gt;Also, check out these amazing LeetCode resources for further reading:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://neetcode.io/" rel="noopener noreferrer"&gt;NeetCode Patterns&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leetcode.com/explore/" rel="noopener noreferrer"&gt;LeetCode Explore&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy coding! 🎯&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Litigence AI: Transforming Legal Awareness with Technology</title>
      <dc:creator>SURENDAR K S</dc:creator>
      <pubDate>Mon, 20 Jan 2025 07:53:47 +0000</pubDate>
      <link>https://dev.to/surendar_sk/litigence-ai-transforming-legal-awareness-with-technology-5fjf</link>
      <guid>https://dev.to/surendar_sk/litigence-ai-transforming-legal-awareness-with-technology-5fjf</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github"&gt;GitHub Copilot Challenge &lt;/a&gt;: Fresh Starts&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built 🚀
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Litigence AI&lt;/strong&gt; is a legal information platform designed to simplify access to Indian legal knowledge through advanced technology. Built with a focus on underserved communities, it provides personalized legal guidance via a conversational AI interface.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Technical Architecture&lt;/em&gt; 💻
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Developed using Flutter for a seamless user experience, currently in closed testing on the Play Console.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Flask-based backend hosted on Google Cloud Run ensures scalable and efficient processing.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Model&lt;/strong&gt;: Powered by a fine-tuned Vertex AI model with Google's default grounding, enhanced with custom data for improved contextual accuracy.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Infrastructure&lt;/strong&gt;: Firebase supports real-time web hosting and future web-based features.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Implemented Features&lt;/em&gt; ⭐
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Google &amp;amp; OTP Authentication&lt;/strong&gt;: Simplified and secure user access integrated via Firebase.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Law of the Day&lt;/strong&gt;: Educates users daily on relevant laws to foster awareness.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding Flow &amp;amp; Chat Interface&lt;/strong&gt;: Smooth user onboarding and interactive legal guidance through a conversational chat system.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Demo 📱
&lt;/h3&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%2Fbgebu13rvt5wr3v6fm97.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%2Fbgebu13rvt5wr3v6fm97.png" alt="Onboarding Screen I" width="476" height="794"&gt;&lt;/a&gt;&lt;/p&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%2Ffr7by75nouej20ebpchu.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%2Ffr7by75nouej20ebpchu.png" alt="Auth Screen" width="477" height="795"&gt;&lt;/a&gt;&lt;/p&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%2Fzd1j1fg0jgvt7rmql5g0.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%2Fzd1j1fg0jgvt7rmql5g0.png" alt="Otp-auth" width="477" height="795"&gt;&lt;/a&gt;&lt;br&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%2Fkwonv413ttz97se78lkh.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%2Fkwonv413ttz97se78lkh.png" alt="Chat First Screen" width="477" height="795"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Installation 📥
&lt;/h3&gt;

&lt;p&gt;Release Mobile App - &lt;a href="https://github.com/surendar-05/Litigence-AI-Frontend/releases" rel="noopener noreferrer"&gt;Direct Link 🔗&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Repo 📂
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/surendar-05" rel="noopener noreferrer"&gt;
        surendar-05
      &lt;/a&gt; / &lt;a href="https://github.com/surendar-05/Litigence-AI-Frontend" rel="noopener noreferrer"&gt;
        Litigence-AI-Frontend
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Legal Chat App&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://flutter.dev/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/216e3a7c7b6df6440731ba68ff3952e50be2947cadfb08e0c903c5df5f9e0041/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506c6174666f726d2d466c75747465722d626c75652e737667" alt="Platform"&gt;&lt;/a&gt;
&lt;a href="https://developer.android.com/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/cbaf59bff9eac4db1763a2bea8aec8806669bd50c7a2907ceb95fff634d00204/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506c6174666f726d2d416e64726f69642d677265656e2e737667" alt="Platform"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is a Flutter-based chat application that utilizes the Gemini API for communication.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Project Overview&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This application provides a basic chat interface where users can send and receive messages. The Gemini API is used to handle the communication logic.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Real-time chat functionality.&lt;/li&gt;
&lt;li&gt;Integration with the Gemini API.&lt;/li&gt;
&lt;li&gt;User authentication (using Firebase).&lt;/li&gt;
&lt;li&gt;Basic message display and input.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Project Setup&lt;/h2&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Flutter:&lt;/strong&gt; If you haven't already, install Flutter by following the instructions on the official Flutter website: &lt;a href="https://flutter.dev/docs/get-started/install" rel="nofollow noopener noreferrer"&gt;https://flutter.dev/docs/get-started/install&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clone the repository:&lt;/strong&gt; Clone this repository to your local machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install dependencies:&lt;/strong&gt; Navigate to the project directory and run &lt;code&gt;flutter pub get&lt;/code&gt; to install the required dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure Firebase:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Create a Firebase project and add the &lt;code&gt;google-services.json&lt;/code&gt; file to the &lt;code&gt;android/app&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;Enable Firebase Authentication for your project.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up Gemini API:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Configure any necessary API keys or credentials for the Gemini API within the application code (e.g., in &lt;code&gt;lib/services/gemini_service.dart&lt;/code&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/surendar-05/Litigence-AI-Frontend" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/surendar-05" rel="noopener noreferrer"&gt;
        surendar-05
      &lt;/a&gt; / &lt;a href="https://github.com/surendar-05/Litigence-AI-Backend" rel="noopener noreferrer"&gt;
        Litigence-AI-Backend
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Overview&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This application provides a Flask-based API that can be run locally or deployed in a Google Cloud environment. Below are step-by-step instructions on installing dependencies, configuring Google Cloud, running the application, and testing the API locally.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Prerequisites&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Python 3&lt;/strong&gt; (for running the Flask application)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Cloud SDK&lt;/strong&gt; (for Google Cloud integration)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;curl&lt;/strong&gt; (for API testing)&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Running the Application Locally&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Clone or open the repository.&lt;/li&gt;
&lt;li&gt;Ensure you have installed Python dependencies (if applicable, use &lt;code&gt;pip install -r requirements.txt&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Run the application:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;python main.py&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This starts the application at &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installing Google Cloud SDK&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Use the steps below on a Linux x86_64 machine:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
tar -xf google-cloud-cli-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;(Optional) Add the Google Cloud CLI to your PATH:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Example approach&lt;/span&gt;
&lt;span class="pl-c1"&gt;echo&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;source ~/google-cloud-sdk/path.bash.inc&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="pl-k"&gt;~&lt;/span&gt;/.bashrc
&lt;span class="pl-c1"&gt;source&lt;/span&gt; &lt;span class="pl-k"&gt;~&lt;/span&gt;/.bashrc&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Initialize the SDK:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;./google-cloud-sdk/bin/gcloud init&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Follow the prompts to choose your Google Cloud project and configure…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/surendar-05/Litigence-AI-Backend" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Copilot Experience ⚡
&lt;/h3&gt;

&lt;p&gt;GitHub Copilot was my coding superhero! Here's how it supercharged development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smart Autocomplete&lt;/strong&gt;: Blazing-fast code generation for Flask and Flutter&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Pair Programming&lt;/strong&gt;: Intelligent suggestions for complex implementations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Prevention&lt;/strong&gt;: Helped craft robust error handlers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing Magic&lt;/strong&gt;: Quick generation of comprehensive test cases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Refinement&lt;/strong&gt;: Continuous suggestions for cleaner, better code&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  GitHub Models 🤖
&lt;/h3&gt;

&lt;p&gt;While Litigence AI currently uses Vertex AI for its production environment (leveraging Google's grounding capabilities and Gemini's custom data integration), we're actively experimenting with GitHub Models, particularly o1, for enhanced RAG capabilities. Our testing involves comparing response accuracy and contextual understanding between different models. The results from these experiments will guide our future model selection, ensuring we deliver the most accurate and reliable legal guidance to our users. &lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion 🎯
&lt;/h3&gt;

&lt;p&gt;Building Litigence AI has been an incredible journey for &lt;a class="mentioned-user" href="https://dev.to/karthidreamr"&gt;@karthidreamr&lt;/a&gt;, transforming a personal mission into a powerful tool for social change. Through the strategic use of GitHub Copilot and cloud technologies, what started as a response to childhood observations of legal inequality is now evolving into a platform that makes legal knowledge accessible to everyone.&lt;/p&gt;

&lt;p&gt;The future of Litigence AI looks promising as we continue to enhance features and scale our impact. Together, we're working to ensure that legal awareness becomes a fundamental right, not a privilege! 🌟&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
