🚀 Happy Wednesday, everyone! Today, I want to dive deeper into C#—a language that's not just versatile but also incredibly powerful for building robust applications. 💡 Did you know that C# supports a feature called "LINQ" (Language Integrated Query)? It allows you to write concise and readable queries directly in your C# code, making data manipulation much more efficient. Here’s a quick example: ```csharp var numbers = new List<int> { 1, 2, 3, 4, 5 }; var evenNumbers = numbers.Where(n => n % 2 == 0).ToList(); Console.WriteLine(string.Join(", ", evenNumbers)); // Output: 2, 4 ``` This simple snippet filters out even numbers from a list using LINQ—easy to read and powerful! What are some of your favorite C# features? Let’s share and learn from each other! #CSharp #Coding #SoftwareEngineering #ProgrammingTips
Exploring C# and LINQ for efficient data manipulation
More Relevant Posts
-
🚀 Happy Wednesday, everyone! Today, let’s dive into C# - a powerful and versatile language that's a cornerstone of many applications! One feature I absolutely love is the use of **LINQ (Language Integrated Query)**. It allows you to query collections in a concise and readable way. Imagine having a list of products and wanting to filter out the ones under a certain price. With LINQ, this becomes incredibly straightforward: ```csharp var affordableProducts = products.Where(p => p.Price < 50).ToList(); ``` Not only does it reduce boilerplate code, but it also enhances readability! 🌟 What are some of your favorite C# features or tips? Let’s share and learn together! 💬 #CSharp #Coding #SoftwareEngineering #DeveloperCommunity
To view or add a comment, sign in
-
📌 Day 18/100 - Valid Palindrome (LeetCode 125) 🔹 Problem: Determine whether a string reads the same forward and backward, ignoring case and non-alphanumeric characters. 🔹 Approach: Implemented a two-pointer technique. Skipped all non-alphanumeric characters. Compared characters from both ends in lowercase. Returned true if all matched, otherwise false. 🔹 Key Learning: Two-pointer method keeps logic clean and efficient. Character handling is key when data isn’t uniform. Time complexity: O(n), Space complexity: O(1). Sometimes, solving elegantly is better than solving fast. ✨ #100DaysOfCode #LeetCode #Java #ProblemSolving #DSA #CodingJourney
To view or add a comment, sign in
-
-
📌 Day 24/100 - Maximum Points You Can Obtain from Cards (LeetCode 1423) 🔹 Problem: You’re given an array of card points where each card has some value. You can take exactly k cards — but only from the beginning or end of the row. The goal is to maximize your total score. 🔹 Approach: This problem is a perfect case for the sliding window technique. Start by taking the sum of the first k cards (left side). Then, gradually move one card from the left side to the right side — each time removing one card from the start and adding one from the end. Track the maximum sum at each step. ✅ This gives an O(k) time solution — efficient and clean! 🔹 Key Learning: Use sliding window when you need to balance two ends dynamically. Prefix sums aren’t always needed — direct window manipulation works wonders. Optimization often lies in reducing repeated work, not complex math. A simple yet powerful logic: “Take, replace, compare — repeat!” #100DaysOfCode #LeetCode #Java #ProblemSolving #DSA #SlidingWindow #CodingJourney
To view or add a comment, sign in
-
-
🚀 Just solved LeetCode 30 – Substring With Concatenation of All Words. 🧩 What was the problem? Given a string and a list of words (all same length), you have to find every starting index where all the words appear together as a continuous substring, in any order. Basically a sliding-window puzzle with fixed word sizes and frequency matching. 🛠️ What was my approach? • Counted all words using a map • Used multiple sliding windows based on word length • Expanded the window word by word • If a word appeared more than needed, I moved the left pointer forward • Added the index when the window matched every word exactly The key was treating the string in equal chunks, not character by character. 📚 What I learned Working with strings becomes much easier when you break the problem into predictable pieces. Managing window boundaries is the real challenge here, and walking through tiny examples helps more than you think. #LeetCode #Java #DSA #CodingPractice #ProblemSolving
To view or add a comment, sign in
-
-
🚀 𝗗𝗮𝘆 𝟮𝟰𝟱 𝗼𝗳 𝟮𝟰𝟳 𝗟𝗲𝗲𝘁𝗖𝗼𝗱𝗲 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲 🔹 Problem: 📘 91. Decode Ways 🧩 Approach: We are given a string of digits, and we must determine how many ways it can be decoded to letters (using mapping "1" -> 'A' to "26" -> 'Z'). Dynamic Programming (DP) is used to count possible decodings by analyzing single and two-digit combinations. 📘 Steps to Solve: If the string starts with '0', return 0 (invalid code). Use a DP array where dp[i] represents the number of ways to decode up to index i. For each index i, check: The single digit (s[i-1]) is valid (1–9). The two-digit substring (s[i-2..i-1]) is valid (10–26). Add valid possibilities to build dp[i]. The final answer is dp[n]. ✅ Time Complexity: O(n) ✅ Space Complexity: O(n) ✨ What I Learned Today: Dynamic Programming simplifies complex recursive problems by storing partial solutions — a beautiful example of optimization in action! 💡 Let's do this! #LeetCode #Day247 #Java #DynamicProgramming #MediumProblem #247Challenge #CodingJourney
To view or add a comment, sign in
-
-
📅 Days 57–64 of My Coding Journey — Diving Deep into Java Exception Handling, Threads & Real-World Projects 💻 Over the past week, I explored some of the most practical and powerful concepts in Java that take coding from theory to real-world application. 💡 Topics I covered: ✅ Exception Handling – mastering try-catch-finally blocks, and creating Custom Exceptions for cleaner error control. ✅ Multithreading – understanding how threads work, how to start and manage them efficiently. ✅ StringBuilder & StringBuffer – learning the difference between mutable classes and thread safety in string manipulation. ✅ Explored important String methods to handle text effectively. ✅ Built a Patient Management System 🏥 — implementing OOP principles, exceptions, and thread usage in one project. #Day57 #Day58 #Day59 #Day60 #Day61 #Day62 #Day63 #Day64 #Java #ExceptionHandling #Threads #StringBuilder #StringBuffer #OOPS #CodingJourney #SoftwareEngineering #100DaysOfCode #LearningInPublic #KunalKushwaha #ProblemSolving
To view or add a comment, sign in
-
📌 Day 4/100 - Minimum Size Subarray Sum (LeetCode 209) 🔹 Problem: Given an array of positive integers and a target value, find the minimal length of a contiguous subarray whose sum is greater than or equal to the target. If there’s no such subarray, return 0. 🔹 Approach: Used the Sliding Window technique for an optimized solution: Initialize two pointers (low, high) and a running sum. Expand the window by moving high until the sum ≥ target. Once valid, shrink the window from the left to find the smallest subarray. Keep updating the minimum length throughout. This reduced the time complexity from O(n²) (brute force) to O(n). 🔹 Key Learning: Sliding Window is ideal for problems with contiguous subarrays. Optimization often comes from adjusting the window efficiently. Each problem strengthens logical flow and pattern recognition. Another step forward in mastering DSA and problem-solving consistency! ⚡ #100DaysOfCode #LeetCode #Java #ProblemSolving #DSA #CodingChallenge #SlidingWindow
To view or add a comment, sign in
-
-
💻 Day 11 of #100DaysOfLeetCode – Rotate Image Today’s challenge was “Rotate Image”, a classic matrix manipulation problem that tests both logic and spatial reasoning. 🔹 Problem Statement: Given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise) — all in place, without using extra memory for another matrix. 🔹 My Approach (in Java): I used a two-step in-place transformation technique: 1️⃣ Transpose the matrix — swap elements across the diagonal (matrix[i][j] ↔ matrix[j][i]). 2️⃣ Reverse each row — to achieve the 90° clockwise rotation. This approach ensures O(1) extra space and O(n²) time complexity, which is optimal for this problem. 🔹 Key Takeaways: ✅ Learned how matrix transformations can be broken down into simpler operations. ✅ Improved understanding of in-place algorithms and memory efficiency. ✅ Reinforced clean coding habits and edge case handling. Every rotation brings me one step closer to mastering problem-solving patterns! 💪 #100DaysOfLeetCode #CodingJourney #RotateImage #Java #DSA #ProblemSolving #LeetCode #CodingChallenge #LearningEveryday
To view or add a comment, sign in
-
-
🔹 Day 38 – LeetCode Practice Problem: Missing Number (LeetCode #268) 📌 Problem Statement: You are given an array nums containing n distinct numbers taken from the range [0, n]. Find the one number that is missing from the array. ✅ My Approach (Java): Calculated the expected sum using the formula total = \frac{n \times (n + 1)}{2} The missing number = total - actual sum. This method avoids sorting or extra space, keeping it optimal. 📊 Complexity: Time Complexity: O(n) Space Complexity: O(1) ⚡ Submission Results: Accepted ✅ Runtime: 0 ms (Beats 100%) 🚀 Memory: 45.51 MB (Beats 32.44%) 💡 Reflection: A great reminder that sometimes the most efficient solutions come from simple mathematical reasoning. Clean, elegant, and lightning-fast! #LeetCode #ProblemSolving #Java #DSA #CodingPractice #Learning
To view or add a comment, sign in
-
-
🚀 Just solved LeetCode 648 – Replace Words. 🟩 What was the problem? You’re given a list of root words and a sentence. For every word in the sentence, you need to replace it with the shortest root that matches its prefix. If multiple roots match, you pick the smallest one. If none match, you leave the word as it is. 🛠️ What was my approach? • Grouped all roots in a HashMap based on their first character • Split the sentence into individual words • For each word, checked only the relevant roots (same starting character) • Picked the shortest matching root if multiple matched • Built the final updated sentence using a StringBuilder This avoided checking every root against every word and kept things pretty efficient. 📚 What I learned Working with strings becomes simpler when you organize the data around predictable patterns. Grouping roots by their first letter saved a lot of unnecessary comparisons. Small structural changes make the whole solution cleaner. #LeetCode #Java #DSA #CodingPractice #ProblemSolving
To view or add a comment, sign in
-
More from this author
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