Day 34 / #120DaysOfCode – LeetCode Challenge ✅ Problem Solved: • Longest Harmonious Subsequence (LHS) 💻 Language: Python 📚 Key Learnings: • Used HashMap (Counter) to store frequency efficiently • Learned how to identify harmonious pairs (num & num + 1) • Improved understanding of frequency-based problems • Practiced optimizing solution using O(n) approach • Strengthened problem-solving using pattern recognition Small consistency → Big improvement 📈 🔗 LeetCode Profile: https://lnkd.in/gbeMKcv5 #LeetCode #Python #DSA #HashMap #CodingJourney #Consistency #120DaysOfCode
Longest Harmonious Subsequence in Python with HashMap
More Relevant Posts
-
Day 35 / #120DaysOfCode – LeetCode Challenge ✅ Problem Solved: • Minimum Distance Between Equal Elements 💻 Language: Python 📚 Key Learnings: • Used HashMap (defaultdict) to store indices of elements • Learned how to track positions efficiently • Applied distance calculation between indices • Improved understanding of index-based problems • Practiced optimizing solution using O(n) approach Consistency + Practice = Progress 📈 🔗 LeetCode Profile: https://lnkd.in/gbeMKcv5 #LeetCode #Python #DSA #HashMap #Algorithms #CodingJourney #Consistency #120DaysOfCode
To view or add a comment, sign in
-
-
Day 37 / #120DaysOfCode – LeetCode Challenge ✅ Problem Solved: • Search a 2D Matrix 💻 Language: Python 📚 Key Learnings: • Applied Binary Search on a 2D matrix • Learned how to treat matrix as a flattened sorted array • Practiced converting 1D index → 2D index (row, col) • Improved understanding of search space reduction • Strengthened logarithmic time complexity (O(log n)) thinking Better logic → Faster execution 🚀 🔗 LeetCode Profile: https://lnkd.in/gbeMKcv5 #LeetCode #Python #DSA #BinarySearch #Algorithms #CodingJourney #Consistency #120DaysOfCode
To view or add a comment, sign in
-
-
Day 28 / #120DaysOfCode – LeetCode Challenge 🚀 Consistency is building momentum 💯 Today’s focus was on String Processing and Frequency Counting, using Python’s built-in tools for efficient solutions. ✅ Problem Solved: • Most Common Word 💻 Language: Python 📚 Key Learnings: • Used regex (re.findall) to extract words cleanly • Applied Counter to count word frequency efficiently • Learned how to handle case-insensitive strings • Filtered out unwanted words using conditions Clean code + built-in functions = powerful solutions 🚀 Every day improving step by step 💪 🔗 LeetCode Profile: https://lnkd.in/gbeMKcv5 #LeetCode #Python #DSA #Strings #Regex #ProblemSolving #CodingJourney #Consistency #120DaysOfCode
To view or add a comment, sign in
-
-
Python Clarity Series – Episode 25 Topic: Mutable vs Immutable Function Behavior 📌 Why did my list change after function call? def modify(lst): lst.append(100) a = [1, 2] modify(a) print(a) Output: [1, 2, 100] 👉 Lists are mutable → changes reflect outside Now: def modify(x): x = x + 10 a = 5 modify(a) print(a) Output: 5 👉 Integers are immutable → no change outside 💡 Rule: Mutable → changes persist Immutable → changes don’t This confusion causes logic errors. #PythonBasics #FunctionConcepts #StudentClarity #python #clarity
To view or add a comment, sign in
-
-
🐍 Day 116 — Cross Validation Day 116 of #python365ai 🔁 Cross-validation splits data multiple times. Example: from sklearn.model_selection import cross_val_score 📌 Why this matters: Provides more reliable performance estimates. 📘 Practice task: Run cross-validation on a model. #python365ai #CrossValidation #MachineLearning #Python
To view or add a comment, sign in
-
-
Day 9 of #111DaysOfLearningForChange – Code for Change Today I learned about List comprehesion. List comprehension is a concise and elegant way to create lists in Python. It allows you to transform or filter data from an existing iterable (like a list, tuple, or range) and pack it into a new list, usually in a single line of code. #111DaysOfLearningForChange #CodeForChange #Day9LearningForChange #Python #DataScience #AI/ML
To view or add a comment, sign in
-
-
Day 39 / #120DaysOfCode – LeetCode Challenge ✅ Problem Solved: • Integer to Roman 💻 Language: Python 📚 Key Learnings: • Learned how to map numerical values to symbolic representations • Used greedy approach for optimal conversion • Understood importance of ordered value-symbol pairing • Practiced handling special subtraction cases (IV, IX, XL, etc.) • Improved skills in writing structured and readable logic Consistency + Logic = Growth 🚀 🔗 LeetCode Profile: https://lnkd.in/gbeMKcv5 #LeetCode #Python #DSA #Algorithms #CodingJourney #Greedy #120DaysOfCode
To view or add a comment, sign in
-
-
Day 60/100 — #100DaysOfCodingChallenge 60 days in… consistency is slowly turning into a habit now. 🔹 Python (DSA) Solved Search a 2D Matrix — used binary search by treating the matrix like a flattened sorted array. It was a nice reminder of how powerful binary search can be when applied smartly. 🔹 SQL Did some light practice to keep concepts fresh and maintain the streak. #Python #SQL #DSA #LeetCode #Day60 #100DaysOfCode #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
🐍 Day 117 — Hyperparameter Tuning Day 117 of #python365ai ⚙️ Tune model settings to improve performance. Example: from sklearn.model_selection import GridSearchCV 📌 Why this matters: Small changes can significantly improve results. 📘 Practice task: Tune one parameter in a model. #python365ai #HyperparameterTuning #ML #Python
To view or add a comment, sign in
-
-
Python Series — Day 3 🧠 Let’s level it up a bit 👇 What will be the output of this code? def modify_list(lst): lst.append(4) a = [1, 2, 3] modify_list(a) print(a) Options: A. [1, 2, 3] B. [1, 2, 3, 4] C. Error D. None Think carefully 👀 (Hint: It’s not about functions… it’s about how Python handles data) Drop your answer 👇 Answer tomorrow 🚀 #Python #CodingChallenge #LearningInPublic #DataEngineering #Tech
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