Day 37 & 38 complete! 🚀 Finding Minimum and Maximum in an Array: Practiced single-pass iterations to identify the extreme values in a dataset, focusing on minimizing comparisons. Count Each Vowel in a String: Used a dictionary to map and count the frequency of vowels. This was great practice for handling case sensitivity and string traversal. First Unique Character in a String: Implemented a two-pass approach—first using a Hash Map to store character frequencies, and then iterating to find the first character with a count of one. Sometimes going back to the basics is the best way to ensure your logic is bulletproof! 📈 #100DaysOfCode #Python #DSA #LeetCode #ProblemSolving
Day 37 & 38: Practiced Array and String Algorithms
More Relevant Posts
-
🚀 Day 32 – LeetCode Journey Today’s problem: Reverse String II ✔️ Implemented in-place string reversal using two pointers ✔️ Efficiently processed the string in chunks of 2k ✔️ Optimized approach with minimal extra space 💡 Key Insight: Instead of reversing the entire string, we only reverse the first k characters in every 2k block. Using the two-pointer technique makes this both simple and efficient. This problem strengthened my understanding of string manipulation, indexing, and in-place operations. Step by step, becoming a better problem solver 🔥💪 #LeetCode #Day32 #Strings #TwoPointers #Python #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 27/100 – DSA Practice Solved LeetCode 459: Repeated Substring Pattern today. Key Insight: If a string s is formed by repeating a substring, then it will always exist inside: (s + s)[1:-1] Why this works: Doubling the string generates all possible rotations Removing first & last characters avoids trivial matches If s is found in this modified string, it confirms a repeating pattern This elegant trick reduces the problem to a simple one-liner and highlights the power of pattern observation in strings. Approach Used: return s in (s + s)[1:-1] Constant progress > Perfection. On to the next one! #Day27 #100DaysOfCode #DSA #LeetCode #Python #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
Day 08 of #50DaysOfCode Today’s problem: Move Zeroes (LeetCode) Problem Statement: Move all 0s to the end of the array while maintaining the relative order of non-zero elements — all done in-place. Approach: Used the Two Pointer Technique to efficiently rearrange elements in a single pass without extra space. Key Insight: Track the position of the next non-zero element and swap only when necessary. 🔹 Complexity: ⏱ Time: O(n) 📦 Space: O(1) 🔹 Learning Outcome: Improved understanding of in-place array manipulation and optimized swapping logic. #LeetCode #Python #DataStructures #CodingJourney #ProblemSolving #100DaysOfCode #DeveloperLife
To view or add a comment, sign in
-
-
Day-24 #30daysofcode challenge I’ve been diving deep into Python logic lately, specifically mastering if-else conditions. Today, I tackled several challenges including: Finding the greatest among three numbers. Validating triangle properties using side lengths. Range checking for specific numerical bounds. It’s not just about writing code; it’s about understanding the logic that powers it. Onward to more complex algorithms! #Python #CodingJourney #WebDevelopment #LogicBuilding #TechCommunity #Nxtwave #ccbp
To view or add a comment, sign in
-
Solved 𝗟𝗖 𝟮𝟲𝟰𝟬 · Find the Score of All Prefixes of an Array (Medium) First glance at the problem? Skimmed it, saw "prefix" and some operation on elements — 𝗮𝘀𝘀𝘂𝗺𝗲𝗱 𝗶𝘁 𝘄𝗮𝘀 𝘀𝗼𝗺𝗲𝘁𝗵𝗶𝗻𝗴 𝗹𝗶𝗸𝗲 𝘀𝗾𝘂𝗮𝗿𝗶𝗻𝗴. Wrote code. Wrong answer. Read the statement properly this time. Turns out conver[i] = arr[i] + max(arr[0..i]) — each element gets added to the 𝗿𝘂𝗻𝗻𝗶𝗻𝗴 𝗺𝗮𝘅 up to that index. The score of a prefix is just the sum of its conversion array. Track 𝗺𝗮𝘅_𝘀𝗼_𝗳𝗮𝗿 as you iterate, add it to the current element, accumulate into score. 𝗢𝗻𝗲 𝗽𝗮𝘀𝘀, 𝗱𝗼𝗻𝗲. Day 39 — #1000DaysOfLearning #DSA #LeetCode #Python #1000DaysOfLearning #LearningInPublic
To view or add a comment, sign in
-
-
📌 Problem: Merge Strings Alternately 💡 Approach: Used a simple two-pointer / iteration technique to merge both strings character by character. First, iterate up to the minimum length of both strings and append alternately. Then, append the remaining characters from the longer string. ⚙️ Key Insight: Handle unequal string lengths separately Avoid index out-of-bounds by iterating till min(len(word1), len(word2)) ⏱️ Time Complexity: O(n + m) 📦 Space Complexity: O(n + m) merg 📚 What I learned: String manipulation efficiently Handling edge cases when lengths differ #LeetCode #DSA #Coding #ProblemSolving #Python #SoftwareDevelopment #CodingJourney
To view or add a comment, sign in
-
#𝐃𝐚𝐲𝟏𝟐 – 𝐃𝐞𝐭𝐞𝐜𝐭 𝐂𝐲𝐜𝐥𝐞𝐬 𝐢𝐧 𝟐𝐃 𝐆𝐫𝐢𝐝 🚀 📝 Find a cycle of same character (length ≥ 4) in grid. 💡 Approach: DFS + Parent Tracking Visit each cell, explore neighbors with same char If visited neighbor ≠ parent → cycle found ✅ 🔧 Key: Track parent to avoid false 2-step cycles. ⏱️ O(m×n) time | O(m×n) space Cycle detection made simple! 🎯 #LeetCode #Python #100DaysOfCode #DFS #CycleDetection
To view or add a comment, sign in
-
-
🚀 Day 40 – LeetCode Journey Today’s problem: Linked List Cycle ✔️ Solved using Floyd’s Cycle Detection Algorithm (Tortoise & Hare) ✔️ Used two pointers (slow & fast) ✔️ Efficient cycle detection without extra space 💡 Key Insight: If a cycle exists, the fast pointer will eventually meet the slow pointer. This approach avoids using extra memory and works in O(n) time. This problem strengthened my understanding of linked lists and pointer techniques. 40 days of consistency — getting stronger every day 💪🔥 #LeetCode #Day40 #LinkedList #TwoPointers #Python #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 41 – LeetCode Journey Today’s problem: Add Binary ✔️ Implemented binary addition manually ✔️ Handled carry propagation efficiently ✔️ Worked with string manipulation and indexing 💡 Key Insight: Binary addition follows the same rules as decimal addition, but with base 2. Managing the carry correctly is the key to building the final result. This problem improved my understanding of bit-level operations and string handling. Step by step, mastering the fundamentals 🔥💪 #LeetCode #Day41 #Binary #Strings #Python #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 48 – LeetCode Journey Today’s challenge: Substring with Concatenation of All Words ✔️ Solved using sliding window + hashmap ✔️ Processed string in fixed-length chunks ✔️ Tracked word frequency efficiently 💡 Key Insight: Instead of checking every substring blindly, splitting the string into word-sized pieces and using a hashmap helps validate matches efficiently. Sliding window keeps the solution optimized. This problem was a great exercise in string manipulation, hashing, and window techniques 🧠 Consistency is the real game changer 🚀 #LeetCode #Day48 #SlidingWindow #HashMap #Strings #Python #ProblemSolving #CodingJourney #100DaysOfCode https://lnkd.in/gxf4RBT6
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development