Day 17/100 | #100DaysOfDSA Today’s problem: Valid Anagram Two strings. Same letters. Same frequency. That’s it. Approach: • Use a frequency array (size 26) • Increment for first string • Decrement for second string • If all values → 0, it’s an anagram Time complexity: O(n) Big takeaway: When order doesn’t matter — count. Simple idea. Efficient solution. Clean execution. ⚡✨ #100DaysOfCode #LeetCode #DSA #Algorithms #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity #SoftwareEngineer #ComputerScience #Consistency #Programmers #TechGrowth
Yogesh ..’s Post
More Relevant Posts
-
Day 18/100 | #100DaysOfDSA Today’s problem: Longest Common Prefix Many strings. One shared start. Approach: • Take first string as prefix • Compare with others • Shrink prefix until it matches • If it becomes empty → no common prefix Time complexity: O(n × m) Big takeaway: Sometimes the solution isn’t adding more — it’s trimming smartly. Less guesswork. More refinement. 💡✨ #100DaysOfCode #LeetCode #DSA #Algorithms #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity #SoftwareEngineer #ComputerScience #Consistency #Programmers #TechGrowth
To view or add a comment, sign in
-
-
Day 33/100 | #100DaysOfDSA 🌳💻 Today’s problem: Binary Tree Postorder Traversal Postorder follows a simple rule: Left → Right → Root Approach: • Use recursion • Traverse left subtree • Traverse right subtree • Add the root at the end This ensures children are processed before the parent. Time Complexity: O(n) Space Complexity: O(h) (recursion stack) Big takeaway: Tree traversals are just different visiting orders — mastering them builds strong tree intuition. Stacking tree patterns daily. 🚀 #100DaysOfCode #LeetCode #DSA #BinaryTree #Trees #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity #SoftwareEngineer #Consistency #Programmers #TechGrowth
To view or add a comment, sign in
-
-
Day 35/100 | #100DaysOfDSA 🌳💻 Today’s problem: Same Tree The goal is to determine whether two binary trees are identical — meaning they have the same structure and the same node values. Approach: • Use recursion to traverse both trees simultaneously • If both nodes are null → they match • If one node is null and the other isn’t → trees are different • If node values differ → trees are different • Recursively check the left and right subtrees Both trees must match at every node for them to be considered the same. Time Complexity: O(n) Space Complexity: O(h) (recursion stack) Big takeaway: When comparing two trees, traverse them in parallel and validate structure and values at each step. Simple logic, but a great exercise for strengthening recursive tree thinking. One more tree pattern learned. 🚀 #100DaysOfCode #LeetCode #DSA #BinaryTree #Trees #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity #SoftwareEngineer #Consistency #Programmers #TechGrowth
To view or add a comment, sign in
-
-
Day 5 – Longest Consecutive Sequence. Today's problem focused on finding the longest consecutive sequence in an unsorted array, which helps strengthen understanding of sorting, edge cases, and sequence tracking. Approach Step 1 – Sort the Array Step 2 – Traverse the Array While iterating: 1️⃣ If elements are equal → skip duplicates 2️⃣ If nums[i] == nums[i-1] + 1 → increase sequence count 3️⃣ Otherwise → reset the count. Step 3 – Track Maximum Length. Github Code :- https://lnkd.in/gF8DqckJ #LeetCode #DSA #StriverA2Z #CodingJourney #Java #Arrays #ProblemSolving #CodingPractice #SoftwareEngineering #TechInterviewPrep #100DaysOfCode #DeveloperJourney #ComputerScience
To view or add a comment, sign in
-
-
Day 32/100 | #100DaysOfDSA 🌳✨ Today’s problem: Symmetric Tree A tree is symmetric if the left subtree is the mirror of the right subtree. Approach: • Use two queues • Compare left and right nodes together • Check mirror conditions at every step If values mismatch → Not symmetric. Time Complexity: O(n) Space Complexity: O(n) Big takeaway: Symmetry in trees is just mirror comparison at every level. Understanding trees deeper every day. 🚀 #100DaysOfCode #LeetCode #DSA #BinaryTree #Trees #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity #SoftwareEngineer #Consistency #Programmers #TechGrowth
To view or add a comment, sign in
-
-
Today I solved the classic problem: Longest Substring Without Repeating Characters This problem teaches one of the most important techniques in DSA — the Sliding Window Algorithm. 🔹 Used HashMap for tracking character positions 🔹 Optimized solution to O(n) time complexity 🔹 Strengthened understanding of two-pointer technique #DSA #DataStructures #Algorithms #LeetCode #Java #ProblemSolving #CodingJourney #100DaysOfCode #SoftwareDeveloper #TechLearning #Consistency #CodingPractice #InterviewPreparation #SlidingWindow #GrowthMindset
To view or add a comment, sign in
-
🚀 Day 89 - #100DaysOfCode Today I solved a problem on finding the smallest common element between two sorted arrays. 🧩 Problem Given two integer arrays, return the first common element between them. If no common element exists, return -1. 💡 Approach I used a HashSet to efficiently check for common elements. Steps: 1️⃣ Insert all elements of the first array into a HashSet. 2️⃣ Traverse the second array. 3️⃣ Check if the current element exists in the set. 4️⃣ If found, return that element immediately. 5️⃣ If no common element is found, return -1. ⏱ Time & Space Complexity Time Complexity: O(n + m) Space Complexity: O(n) 📌 Key Learning: Using a HashSet helps reduce lookup time to O(1), making the solution efficient #DSA #Java #CodingJourney #LeetCode #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
Approached this problem using recursion by traversing both left and right subtrees and keeping track of the maximum depth encountered. The idea is simple: Depth of a tree = 1 + max(depth of left, depth of right) This problem strengthened my understanding of tree traversal and recursive thinking. Consistent practice with tree problems to improve problem-solving skills step by step 🚀 #LeetCode #DataStructures #Java #BinaryTree #DSA #CodingJourney
To view or add a comment, sign in
-
-
Every problem teaches something new — today it was LeetCode 50: Pow(x, n) At first, it looked simple: just calculate power. But the real challenge was optimizing it and handling edge cases like negative powers and Integer.MIN_VALUE overflow. Learned how Binary Exponentiation can turn an O(n) solution into O(log n) — that’s the beauty of algorithms! Moments like these remind me that problem-solving is not just about writing code, but thinking deeper. #LeetCodeJourney #DSA #KeepLearning #Java #ProblemSolving
To view or add a comment, sign in
-
-
Day 45/100 | #100DaysOfDSA 🚀🧩 Today’s problem: Remove All Occurrences of a Substring The task is simple: Given a string s and a substring part, keep removing the leftmost occurrence of part until it no longer exists in s. Approach: • Use StringBuilder for efficient modifications • Find the index of part using indexOf() • Delete that portion from the string • Repeat the process until part is no longer found Time Complexity: O(n × k) in worst case (where n is length of string and k is length of substring) Big takeaway: Sometimes the easiest solution is just repeating a simple operation until the condition disappears. Clean string manipulation problem today. 🔥 Day 45 done. #100DaysOfCode #LeetCode #DSA #Algorithms #Java #String #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity
To view or add a comment, sign in
-
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