🌟 Day 76 of my 100-day coding challenge: Today, I solved LeetCode Problem 14: "Longest Common Prefix." My Approach: To find the longest common prefix, I used a helper function MaxPrefix that compares two strings and returns the longest common prefix between them. Starting with the first string in the array, I iterated through all other strings, updating the common prefix as I went. The process stops as soon as there's a mismatch between characters. This problem was a great exercise in string comparison and efficient handling of multiple inputs! #100DayCodingChallenge #LeetCodeProblemSolving #Day76 #LongestCommonPrefix
RISHI SHARMA’s Post
More Relevant Posts
-
💥 Day #32/100 of the G. Vishwanathan Coding Challenge ✔️ Just completed the Delete Characters to Make Fancy String problem on LeetCode! 🎉💻 This problem focused on string manipulation, where the goal was to create a “fancy” string by removing consecutive duplicates. 🌟✂️ I loved working on this efficient solution, optimizing string traversal and character conditions! 🔥💪 Every challenge hones my coding skills further and keeps the momentum going strong. 🚀💯 Excited to see what tomorrow brings—let’s keep climbing! 🙌😇 #Day32 #100DaysOfCode #GVishvanathanCodingChallenge #LeetCodeChallenge #StringManipulation #ProblemSolving #LevelUp #CodingJourney #SoftwareEngineering #KeepPushing #GrowthMindset
To view or add a comment, sign in
-
🚀 Day 42 of #100DaysOfCode 🖥️: Today, tackled a challenging coding question! 🤓 Delved into the intricacies of balancing parentheses, curly brackets, and square brackets in a string. Difficulty level: Medium #cpp #datastructuresandalgorithms #stack #ProgrammingJourney #AlgorithmMastery #100daysofcode #drgvishwanathanchallenge💪
To view or add a comment, sign in
-
🚀 Day 2/75 of the Leetcode 75 Coding Challenges! 1071. Greatest Common Divisor of Strings (https://lnkd.in/gXWMzEx4) Github Link: (https://lnkd.in/gtPTSHwY) Youtube Video : https://lnkd.in/g64mWACZ Just for fun: (https://lnkd.in/g4FpnSnG) #leetcodechallenge #75dayschallenge #codingjourney #problemsolving #keepcoding #dsachallenge
To view or add a comment, sign in
-
#day-06/75 #Leetcode75 🌟 #In my 75 Days coding challenge in #Leetcode 💫 I solved three problems related to strings concepts: Greatest common Divisor of Strings ,Reverse Vowels of String, Reverse Words of string 📚
To view or add a comment, sign in
-
🌟 Day 77 of my 100-day coding challenge: Today, I solved LeetCode Problem 876: "Middle of the Linked List." My Approach: To find the middle node of a singly linked list, I first calculated the total size of the list by traversing it once. Then, I computed the middle index. If there are two middle nodes, I chose the second one. After that, I traversed the list again up to the middle index and returned the middle node. This was a great practice for working with linked lists and understanding traversal techniques. #100DayCodingChallenge #LeetCodeProblemSolving #Day77 #LinkedLists
To view or add a comment, sign in
-
Day 29 of my 100-day coding challenge: Solved the 'Valid Parentheses' problem on LeetCode! 🔍 Given a string containing various types of brackets, I determined if the input string is valid by ensuring each open bracket has a corresponding close bracket in the correct order. Each challenge hones my problem-solving skills and keeps the journey exciting. On to the next one! 💻✨ #100DaysOfCode #CodingJourney #LeetCode
To view or add a comment, sign in
-
Day 55 of my 100-day coding challenge: Solved the 'Longest Repeating Character Replacement' problem on LeetCode! 🔠✨ Given a string and an integer k, I found the length of the longest substring containing the same letter after changing up to k characters. Loving the challenge and growth each day brings! 💻 #100DaysOfCode #CodingJourney #LeetCode
To view or add a comment, sign in
-
🌟 Day 73 of my 100-day coding challenge: Today, I worked on LeetCode Problem 867: "Transpose Matrix." My Solution: I created a new 2D array arr with flipped dimensions (rows become columns and vice versa). By iterating through the original matrix, I swapped the row and column indices to transpose the matrix. This effectively flips the matrix over its main diagonal. A good refresher on matrix manipulation! 💻 #100DayCodingChallenge #LeetCodeProblemSolving #Day73
To view or add a comment, sign in
-
#leetcode #30Days of coding challenge #Day04 Today I have done leetcode no.74 Explanation The objective of this problem is to find if the target is present In a 2d arrays and return true if it exists (With Time complexity O(log(m * n))) We will perform the binary search two times Step1: To find which row has the target we will find the middle of the array Step2: Then we will check the last element of that middle array if it the last element is larger than or the first element is smaller than the target we will know the array has the target in between that array Step3:And We will again perform the binary search again on that array to find the target if it exists return True Since we perform binary search two times the Time complexity is O(log(m * n))
To view or add a comment, sign in
-
Day 67 of my 100-day coding challenge: Solved the 'Random Node in Linked List' problem on LeetCode! 🎲🔗 Given a singly linked list, I implemented a solution to randomly choose and return a node's value, ensuring equal probability for each node. This was a fun challenge involving probability and linked list traversal! Onward to more challenges! 💻 #100DaysOfCode #LeetCode #CodingJourney
To view or add a comment, sign in
PYTHON DEVELOPER || DATA-ANALYST || BUSINESS-ANALYST || INSIGHT-DASHBOARD DEVELOPER || POWER-BI DEVELOPER || DATA SCIENCE & ML
3mokeep going