🚀 Day 42/100 – LeetCode Challenge Solved 206. Reverse Linked List today! 🔍 Problem Summary: Given the head of a singly linked list, reverse the list and return the new head. 💡 Approach: Implemented an iterative solution using three pointers (prev, curr, next) to reverse the links efficiently in-place. Also explored the recursive approach to strengthen understanding of linked list manipulation. ⚡ Complexity: • Time Complexity: O(n) • Space Complexity: O(1) (Iterative) 📌 Key Takeaways: Importance of pointer manipulation Handling edge cases like empty list Difference between iterative vs recursive approaches Consistency is key — one step closer to mastering Data Structures & Algorithms! 💪 #LeetCode #100DaysOfCode #DataStructures #Algorithms #CodingJourney #Python #ProblemSolving #LinkedList
Reverse Linked List Challenge Solved
More Relevant Posts
-
Day 14/100 – Data Structures & Algorithms Today, I worked on the problem “First Unique Character in a String.” Overview The task is to identify the first non-repeating character in a string and return its index. If no such character exists, the result is -1. Approach I used a two-pass strategy: • First pass to store character frequencies using a hashmap • Second pass to identify the first character with a frequency of one Complexity • Time Complexity: O(n) • Space Complexity: O(1) Key Takeaway This problem reinforces how effective hashmaps are for frequency-based problems and how a simple two-pass approach can lead to optimal solutions. Staying consistent and building problem-solving intuition step by step. #Day14 #100DaysOfCode #DSA #Python #LeetCode #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
-
Days 68-69 of the #three90challenge 📊 Today I explored NumPy operations — specifically indexing and slicing arrays. After understanding NumPy basics, this step made it easier to access and manipulate data efficiently. What I practiced today: • Accessing elements using indexing • Extracting subsets of data using slicing • Working with multi-dimensional arrays • Performing operations on selected data Example thinking: Instead of looping through data manually, I can directly select and operate on specific parts of an array. Example: import numpy as np arr = np.array([10, 20, 30, 40, 50]) print(arr[1:4]) # Output: [20 30 40] This makes data manipulation faster and more intuitive. From handling data → to controlling it efficiently 🚀 GeeksforGeeks #three90challenge #commitwithgfg #Python #NumPy #DataAnalytics #LearningInPublic #Consistency #Upskilling
To view or add a comment, sign in
-
🚀 Day 36 – LeetCode Journey Today’s problem: String to Integer (atoi) ✔️ Handled leading spaces and signs (+/-) ✔️ Processed numeric characters step by step ✔️ Managed overflow conditions within 32-bit integer range 💡 Key Insight: Carefully handling edge cases (like spaces, signs, and overflow) is just as important as the core logic. Small conditions can make a big difference in correctness. This problem strengthened my understanding of string parsing, edge cases, and boundary conditions. Learning to write robust and reliable code every day 💪🔥 #LeetCode #Day36 #Strings #EdgeCases #Python #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 4/30 🔹 Problem: Find the second largest number in a list 🔹 What I focused on today: Thinking beyond the obvious solution and handling edge cases 🔹 My Thinking Process: Take a list of numbers from the user Remove duplicate values Sort the list Pick the second last element 👉 Simple idea, but requires careful steps 🔹 Inputs I used: List of numbers 🔹 Code: numbers = list(map(int, input("Enter numbers separated by space: ").split())) # Remove duplicates numbers = list(set(numbers)) # Sort the list numbers.sort() # Find second largest if len(numbers) < 2: print("Not enough elements") else: print("Second Largest Number:", numbers[-2]) 🔹 Example: Input: 10 20 30 40 Output → 30 🔹 Key Takeaway: Breaking a problem into steps like cleaning data, sorting, and selecting values makes it easier to solve #Day4 #Python #30DaysOfCode #LearningInPublic #DataAnalytics #ProblemSolving
To view or add a comment, sign in
-
Vector databases are great, but they aren't always the right tool for complex document intelligence. 🧠📉 If you are tired of context fragmentation and untraceable LLM hallucinations, it is time to look at Vectorless RAG with Page Index. By swapping out mathematical embeddings for a reasoning-based, hierarchical document tree, you can achieve upwards of 98% accuracy on complex Q&A tasks with perfect citation traceability. I wrote a complete guide on how this architecture works, including a full Python code implementation. Read it here: https://lnkd.in/gRuXiSxK #ArtificialIntelligence #RAG #PythonDeveloper #MachineLearning #AIEngineering
To view or add a comment, sign in
-
-
🚀 Day 28 of Problem Solving Journey Today, I worked on an interesting problem: Group Anagrams 🔍 Problem Statement: Given an array of strings, group the anagrams together. Anagrams are words that have the same characters but arranged differently. 💡 Approaches I explored: ✅ Approach 1: Character Frequency Count (Optimized) Used a fixed-size array (26 letters) to count character occurrences Converted the count into a tuple to use as a dictionary key Achieved an efficient time complexity of O(n * k) ✅ Approach 2: Sorting Strings Sorted each string and used it as a key Simple and intuitive approach Time complexity: O(n * k log k) 📌 Key Learning: Understanding how hashing works with different representations (frequency vs sorted string) helps in optimizing solutions. ⚡ Takeaway: There are always multiple ways to solve a problem, but choosing the most efficient one makes a difference in real-world applications and interviews. 💻 Tech Used: Python | HashMap | Arrays #Day28 #ProblemSolving #Python #DataStructures #Algorithms #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Continuing from my previous post https://lnkd.in/gtyziw-6 here is the actual implementation part of the same project. In this video, I’ve shown my full Jupyter Notebook workflow where I performed the analysis step by step. What this includes: • Data preprocessing and filtering • Handling missing and incorrect values • Feature-level analysis • Applying statistical logic to derive insights This is where the real learning happened — not in theory, but in execution. Debugging errors, fixing logic, and making sure the output actually makes sense. Still improving, but this is a solid step toward building practical data skills. #jupyter #python #dataanalytics #statisticsproject #handsonlearning #careerbuilding #datasciencejourney
To view or add a comment, sign in
-
✅ Day 87 of 100 Days LeetCode Challenge Problem: 🔹 #2840 – Check if Strings Can be Made Equal With Operations II 🔗 https://lnkd.in/gY73RBb5 Learning Journey: 🔹 Today’s problem extended the previous one, allowing swaps between indices where the difference is even. 🔹 I observed that this again partitions the string into two independent groups: • Even indices (0, 2, 4, …) • Odd indices (1, 3, 5, …) 🔹 I extracted characters from even and odd positions separately for both strings. 🔹 Then, I sorted these groups and compared them between s1 and s2. 🔹 If both even-index groups and odd-index groups match, the strings can be made equal. Concepts Used: 🔹 String Manipulation 🔹 Index Grouping (Parity-based) 🔹 Sorting 🔹 Greedy Observation Key Insight: 🔹 Since swaps are allowed only between indices with even distance, characters can only move within their parity group. 🔹 Therefore, the problem reduces to checking if both parity groups have identical character distributions. Complexity: 🔹 Time: O(n log n) 🔹 Space: O(n) #LeetCode #Algorithms #DataStructures #CodingInterview #100DaysOfCode #SoftwareEngineering #Python #ProblemSolving #LearningInPublic #TechCareers
To view or add a comment, sign in
-
-
✅ Day 92 of 100 Days LeetCode Challenge Problem: 🔹 #2011 – Final Value of Variable After Performing Operations 🔗 https://lnkd.in/gX-JQNUJ Learning Journey: 🔹 Today’s problem was about evaluating a sequence of increment and decrement operations. 🔹 I initialized a variable ans = 0 to track the value. 🔹 Used a hashmap to map each operation to its effect: • "++X" and "X++" → +1 • "--X" and "X--" → -1 🔹 Iterated through the operations and updated ans accordingly. 🔹 Returned the final computed value. Concepts Used: 🔹 HashMap / Dictionary 🔹 String Matching 🔹 Simple Simulation Key Insight: 🔹 Instead of using multiple condition checks, mapping operations to values simplifies logic and improves readability. Complexity: 🔹 Time: O(n) 🔹 Space: O(1) #LeetCode #Algorithms #DataStructures #CodingInterview #100DaysOfCode #Python #ProblemSolving #LearningInPublic #TechCareers
To view or add a comment, sign in
-
-
🚀 Day 84 of #100DaysOfCode ✅ Solved: Rotate Image (LeetCode 48) Today’s problem was all about rotating an n × n matrix by 90° clockwise — in-place (without using extra space). 💡 Key Insight: Instead of creating a new matrix, we can break the problem into two smart steps: 1️⃣ Transpose the matrix (swap rows with columns) 2️⃣ Reverse each row This transforms the matrix exactly as required — clean and efficient! 🧠 Why this works: - Transpose flips the matrix across its diagonal - Reversing rows completes the 90° clockwise rotation ⚡ Complexity: - Time: O(n²) - Space: O(1) (in-place) 📌 Takeaway: Many matrix problems become easier when broken into transformations like transpose + reverse. Recognizing these patterns is a game-changer in coding interviews. #LeetCode #DataStructures #CodingJourney #Python #100DaysOfCode #ProblemSolving
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