Today, I faced a challenge: finding the length of the longest common substring between two strings. Initially, I tried a brute-force approach, which worked but was painfully slow for larger strings. Determined to find a better solution, I explored various methods and even consulted with a friend. Their suggestion led me to a simpler, more efficient approach: iterating over possible substrings from the first string and checking each against the second string. With this new method, I was able to solve the problem efficiently and effectively. It was a great reminder that sometimes, the simplest solutions are the most powerful. Feeling accomplished and grateful for the support and insights along the way. Here’s to finding elegant solutions and learning from every challenge! 🚀 #geekstreak2024 #ProblemSolving #CodingJourney #Efficiency #Algorithm #TechChallenges
Bhakta Varun B’s Post
More Relevant Posts
-
💡 Day 38 of #100DaysOfProgrammingChallenge 🚀 Challenge Accepted: #145 Binary Tree Postorder Traversal ✨ Let's dive into the traversal techniques of binary trees with the "Binary Tree Postorder Traversal" challenge! 🌳 Given the root of a binary tree, our task is to return the postorder traversal of its nodes' values. In a postorder traversal, we visit the left subtree first, then the right subtree, and finally the root node. Here's a quick example to illustrate: - Input: root = [1,null,2,3] - Output: [3,2,1] Ready to tackle this problem and master the postorder traversal of binary trees? Join me in solving this traversal challenge! 💻 #CodingChallenge #Algorithms #DataStructures #BinaryTrees #TreeTraversal
To view or add a comment, sign in
-
💡 Day 27 of 100 Days Challenge: Solving Tree Problems: finding the sum of left leaves in a binary tree. This solution adeptly traverses the tree, summing values of left leaves as it goes. 💡 #Algorithm #CodingChallenge #TreeTraversal
To view or add a comment, sign in
-
Problem link: https://lnkd.in/gCiq6iVD 🚀 From an idea to 0ms with O(n) efficiency! 🚀 ✨ Key Insights: 💡 Use a monotonic stack to manage partitions dynamically. 💡 Merge overlapping partitions based on maximum and minimum values. Ensure the concatenated result preserves the sorted order. Proud to solve this efficiently and excited for more challenges ahead! 💪 #ProblemSolving #LeetCode #Algorithms #Efficiency
To view or add a comment, sign in
-
🎯This is my Day 14 of #100DaysOfCode🚀 Today's problem was , There is BST given with the root node with the key part as an integer only. You need to find the in-order successor and predecessor of a given key. If either predecessor or successor is not found, then set it to NULL. Note:- In an Inorder traversal the number just smaller than the target is the predecessor and the number just greater than the target is the successor. #DrGViswanathan #100DaysOfCode #AdvancedDSA #CompetitiveCoding #Algorithms #TechJourney
To view or add a comment, sign in
-
What are algorithms
To view or add a comment, sign in
-
1: breadth-first search: A breadth-first search is when you inspect every node on a level starting at the top of the tree and then move to the next level. 2: depth-first search A depth-first search is where you search deep into a branch and don't move to the next one until you've reached the end. #Algorithm #BreadthFirstSearch #DepthFirstSearch #GraphTraversal
To view or add a comment, sign in
-
💡 Day 26 of #100DaysOfProgrammingChallenge 🚀 Challenge Accepted: #21 Merge Two Sorted Lists ✨ Let's delve into the world of linked lists and learn how to merge two sorted ones into a single sorted list! 🔗 Given the heads of two sorted linked lists, `list1` and `list2`, our task is to merge them by splicing together the nodes from both lists, maintaining the sorted order. Here's a quick example to illustrate: - Input: list1 = [1,2,4], list2 = [1,3,4] - Output: [1,1,2,3,4,4] Ready to tackle this problem and master the art of merging sorted linked lists? Join me in solving this elegant challenge! 💻 #CodingChallenge #Algorithms #DataStructures #LinkedLists
To view or add a comment, sign in
-
Day 10 of #100DaysofCodingChallenge: Reconstructing a Shuffled Sentence Solved the problem of reconstructing a sentence from a shuffled version where each word is tagged with its original position. Implemented a solution to split, sort, and reconstruct the sentence efficiently. #CodingChallenge #Algorithm #StringManipulation #100DaysOfCode #bytexl Aamir Jarda byteXL
To view or add a comment, sign in
-
🎯 Day 3 of #100DaysofCode 🚀 Today's problem was, Given an integer n, return true if it is a power of two. Otherwise, return false. An integer n is a power of two, if there exists an integer x such that n == 2x. #DrGViswanathan #100DaysOfCode #AdvancedDSA #CompetitiveCoding #Algorithms #TechJourney
To view or add a comment, sign in
-
28/75:-Binary Tree Preorder Traversal check out the question(144):-https://lnkd.in/grUdqbyA #leetcode #75daysChallenge #algorithm #binaryTree
To view or add a comment, sign in