Day 25 of #100DaysOfCode 🚀 Today’s focus was on sharpening fundamentals with a classic string problem — simple on the surface, yet excellent for refining logical clarity and attention to detail. 🧩 Problem — Consonants and Vowels Check (GfG) The task: Count vowels and consonants in a string and compare them. What made it interesting? Even a basic comparison can fail if you don’t handle spaces, symbols, or case variations. Filtering only valid alphabets before counting was crucial for achieving accurate results. Key Java takeaway: Clarity in input constraints and precise condition handling matter more than complexity. 💡 Key Learning String problems are not just about characters—they’re about discipline in logic: ✔ Clean input ✔ Handle edge cases ✔ Keep code simple and readable Improving these fundamentals builds the precision needed for advanced DSA topics. #100DaysOfCode #Day25 #CodingJourney #JavaDeveloper #DSA #StringProblems #GeeksforGeeks #CodingPractice #LearningEveryday #ProgrammerLife #TechJourney #ProblemSolving #CodingCommunity
#100DaysOfCode Day 25: Consonants and Vowels Check in Java
More Relevant Posts
-
🚀 Day 3 of my 30-Day Coding Challenge with Educative.io Today’s problem looked simple but had some fun twists. The task: given a binary string, find the number of steps to reduce it to 1 by repeatedly 1)dividing by 2 if even 2)adding 1 if odd. At first, I tried converting the binary to a number and then looping. Lesson learned — in JavaScript, large binary strings (length > 53 bits) overflow the Number limit. My approach worked for small inputs but failed for long ones. After debugging, I discovered a smarter pattern: 1)Work directly on the binary string from right to left. 2)Use a carry variable to simulate “add 1” operations. 3)Count operations based on whether the current bit + carry is odd or even. This avoids conversion and runs in O(n) time for strings up to 500 characters! Here’s what I took away from this challenge: Always think about data type limits (JS Number ≠ unlimited integer). Sometimes the best solution is bit-level simulation instead of numeric math. Debugging is just as valuable as solving. #JavaScript #CodingChallenge #Educative #LearningInPublic #DSA #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
✅ Day 70 of #100DaysOfCode🚀 🔎 LeetCode Problem No #3354 – Count Valid Selections 🛠️ Solution - https://lnkd.in/geSxHsxD Today’s challenge was all about prefix sums, conditional counting, and state validation - testing both analytical thinking and edge-case intuition. 💡 Core Concepts Explored: Optimizing array traversal with O(n) linear scans Leveraging prefix/suffix sums for fast cumulative computations Handling decision-based iteration where each index affects multiple outcomes What made this problem interesting was identifying valid transition points dynamically without brute force - a clean example of how logical reasoning and math patterns power algorithmic efficiency. Every day of this challenge reminds me: 👉 Code is not just syntax - it’s the art of structured problem-solving. #100DaysOfCode ✅ #Day70 #LeetCode #ProblemSolving #CodingJourney #DSA #Algorithm #DataStructures #CodingChallenge #DeveloperCommunity #LearnToCode #SoftwareEngineering #CodingLife #Java #CodeNewbie #AIStudent #TechJourney #CodeEveryday #ProgrammingPractice #ProblemSolvingSkills #LeetCodeChallenge #ComputationThinking #CodeMotivation #DataScience #SoftwareDeveloper #CodeBetter #StudyWithMe #TechLearning #ProgrammersLife #BuildInPublic #StudentDeveloper #DailyCoding #SelfImprovement #MindsetMatters #CodingCommunity #LeetCodeDaily #CompetitiveProgramming #TechGrowth
To view or add a comment, sign in
-
-
🌟 #Day7 of my #30DayDSAChallenge 🌟 📘 Mini Project: Dictionary using Hash Tables in C 💻 Today, I built a Simple Dictionary App that uses Hash Tables for fast word lookup ⚡ You can 👉 🔹 Add new words and meanings 🔹 Search any word instantly 🔹 View the entire dictionary Through this project, I learned how hashing helps in efficient data storage and retrieval 🔑 🧠 Concepts covered: ➡️ Hash Functions ➡️ Collisions (basic handling) ➡️ String operations in C Code link 🖇️: https://lnkd.in/gQrTn7_S Every day, one step closer to mastering DSA! 🚀🔥 #Day7 #30DayDSAChallenge #DSA #DataStructures #Algorithms #HashTables #CProgramming #CodingChallenge #LearnDSA #100DaysOfCode #CodingIsFun #ProgrammersCommunity #MiniProject #CodeNewbie #TechJourney #DeveloperLife #CodingDaily #Hashing #DSAWithC #CodePractice #SoftwareEngineering #LearnToCode #TechLearning #ProgrammingLife #DevCommunity #CodeNewbies #CodeEveryday #CSStudents #EngineeringStudents #Techies #ProblemSolving 💻✨
To view or add a comment, sign in
-
💡 Day 98 of My DSA Challenge – Longest Subsequence With Limited Sum 🔷 Problem: 2389. Longest Subsequence With Limited Sum 🔷 Goal: For each query, find the maximum number of elements from nums that can form a subsequence with a sum ≤ query value. 🔷 Key Insight: To maximize the subsequence size, we should always pick smaller elements first — this is a greedy choice. Hence, sorting the array ensures we can accumulate the smallest elements until the sum exceeds the query limit. Approach outline: 1️⃣ Sort the array nums. 2️⃣ For each query, add elements one by one until the sum crosses the limit. 3️⃣ Return the count of elements that fit within the limit. This logic can also be optimized further using prefix sums + binary search, but the greedy approach works perfectly within given constraints. 🔷 My Java Approach: Sort the array. Use a helper function to count how many elements fit under the query sum. Store each result in the answer array. 🔷 Complexity: Time → O(n log n + n × m) Space → O(1) Sometimes, simplicity wins. This problem reinforces the power of greedy thinking — starting small, building up gradually, and knowing when to stop. Recognizing such patterns is key to writing clean and intuitive code. 🚀 #100DaysOfCode #Day98 #LeetCode #DSA #Java #ProblemSolving #GreedyAlgorithm #CodingChallenge #Programming #LearnToCode #CodingLife #SoftwareEngineering #Algorithms #DataStructures #TechJourney #CodeEveryday #EngineerMindset #DeveloperJourney #GrowthMindset #CodeNewbie #KeepLearning #ApnaCollege #AlphaBatch #ShraddhaKhapra
To view or add a comment, sign in
-
-
💡 𝗢𝗻𝗲 𝗟𝗶𝗻𝗲. 𝗕𝗶𝗴 𝗟𝗲𝘀𝘀𝗼𝗻. While solving the “𝗦𝘂𝗯𝗮𝗿𝗿𝗮𝘆 𝗦𝘂𝗺 𝗘𝗾𝘂𝗮𝗹𝘀 𝗞” problem, I stumbled upon a single line that completely changed my understanding of prefix sums and edge cases: 𝗺𝗮𝗽.𝗽𝘂𝘁(𝟬, 𝟭); At first, I didn’t think much of it. Then it hit me — this one line ensures we count subarrays starting right from index 0. 𝗪𝗵𝘆 𝗶𝘁 𝗺𝗮𝘁𝘁𝗲𝗿𝘀: When the running sum equals k, we need sum - k == 0 to exist in the map. Without this initialization, those early subarrays are never counted — a tiny detail that makes the entire logic correct. 💡 𝗪𝗵𝗮𝘁 𝗜 𝗟𝗲𝗮𝗿𝗻𝗲𝗱: ✅ Edge cases aren’t “just” edge cases — they define correctness. ✅ Defensive coding is part of strong problem-solving. ✅ Understanding why each line exists > just writing code. Still a student, still learning — but small discoveries like this remind me how much depth hides in just a few lines of code. Problem link: https://lnkd.in/g4TZqJRM Have you ever had an “𝗮𝗵𝗮!” moment from a single line that changed your whole approach? Drop it below 👇 #CodingJourney #Java #ProblemSolving #DSA #TechInterviews #LearningInPublic #CompetitiveProgramming #StudentLife
To view or add a comment, sign in
-
📌 Day 155 of Coding - Next Greater Numerically Balanced Number (LeetCode - Medium) 🎯 Goal: Find the smallest integer greater than n such that the count of each digit d in the number is exactly d (for digits 1-7). 💡Approach & Debugging: Used backtracking to generate all “beautiful” numbers following the digit count rule. A helper function generate() recursively built numbers by trying digits 1-7, ensuring that no digit appeared more times than its own value. Checked each generated number using isBeautiful(). After generation, sorted the list and returned the first number greater than n. ✔️ Time Complexity: Exponential (backtracking-based generation, but limited by small constraints). ✔️ Space Complexity: O(1) auxiliary + O(M) list for generated numbers. 🧠 Key Takeaways: Precomputation and pruning (like limiting to 1224444) help keep recursion efficient. Problems mixing digit frequency logic and recursion sharpen number theory intuition. #Day155 #LeetCode #Backtracking #Recursion #Java #ProblemSolving #DSA #CodingChallenge #Algorithms #100DaysOfCode #InterviewPrep #SoftwareEngineering #DataStructures #CodeNewbie #ProgrammersLife
To view or add a comment, sign in
-
-
🚀 Day 68 of #100DaysOfChallenge Today's problem: 3461. Check If Digits Are Equal in String After Operations I (LeetCode - Easy) This problem was a fun blend of pattern observation and modular arithmetic — a great reminder that even simple-looking questions can strengthen your logical flow and coding discipline on LeetCode. 🧩 Problem Overview: We’re given a string of digits, and in each step, we repeatedly calculate the sum of every pair of consecutive digits modulo 10, until only two digits remain. Finally, we check whether those two digits are equal. 💡 My Approach: Used a straightforward simulation approach — repeatedly computing new strings of digits using modular arithmetic until only two digits were left. It’s simple, direct, and performs efficiently for short strings. ⚙️ Language: Java ⚡ Runtime: 8 ms (Beats 72.03%) 💾 Memory: 44.67 MB (Beats 69.77%) ✅ Result: Accepted — 706 / 706 test cases passed Every daily problem adds another layer of precision and confidence. Consistency isn’t just about coding every day — it’s about learning something new with every attempt. 🌱 On to the next challenge 💪 #100DaysOfCode #LeetCode #ProblemSolving #Java #CodingChallenge #Programming #DeveloperJourney #LearningEveryday #TechMindset #Consistency
To view or add a comment, sign in
-
-
🚀 Leveling Up with LeetCode — 3 Problems, 3 Learnings 💡 Over the past few days, I’ve been sharpening my DSA skills through some interesting problems on LeetCode. Each one gave me a new perspective on problem-solving and pattern recognition. Here’s a quick breakdown 👇 🔹 1️⃣ Max Consecutive Ones Concept: Counting consecutive 1s using a simple loop. Learning: How to maintain running counts and track maximum streaks efficiently. 🧠 Key idea: Reset count to 0 when a 0 appears, and use Math.max() to update the longest streak. 🔹 2️⃣ Next Greater Element I Concept: For every element in nums1, find the next greater element in nums2. Learning: Nested traversal helps understand how comparisons and indexing work. 🧠 Key idea: Break loops efficiently once the next greater element is found. 🔹 3️⃣ Array Partition Concept: Pair up integers to maximize the sum of minimums. Learning: Sorting plays a crucial role in greedy problems. 🧠 Key idea: After sorting, take every alternate element (since it’ll always be the smaller one in each pair). 💻 Languages/Concepts Used: Java, Arrays, Sorting, Loops, Greedy approach. 📈 Complexity: Most solutions optimized to O(N log N) or better. I’m continuously improving my DSA understanding and consistency on LeetCode — each problem adds a new layer to my logical thinking and confidence. 👉 You can check out my profile here: 🔗 https://lnkd.in/gFH_4R9a #LeetCode #Java #DSA #CodingJourney #ProblemSolving #LearningEveryday #Programming #AmanSingh
To view or add a comment, sign in
-
Day 114/250 🚀 99% of beginners struggle with this simple merge logic! Today I solved the “Merge Sorted Array” problem — one of the most asked coding interview questions (LeetCode #88). The challenge: 👉 Merge two sorted arrays nums1 and nums2 into a single sorted array, without using extra space. 👉 The twist? You must do it in-place, directly inside nums1. 💭 Most people try merging from the front — and overwrite existing elements! The trick is to start from the end of both arrays and fill from the back. Here’s the logic in simple words: 1️⃣ Keep three pointers — one at the end of valid nums1, one at the end of nums2, and one at the last index of nums1. 2️⃣ Compare the elements and place the larger one at the end. 3️⃣ Move backwards until everything is merged. ✅ Time Complexity: O(m + n) ✅ Space Complexity: O(1) ✅ Language Used: C++ 🔥 Hashtags #Coding #LeetCode #Java #DSA #Programming #100DaysOfCode #SoftwareEngineering #CodeNewbie #TechCareer #InterviewPreparation #LeetCodeChallenge #ProgrammersLife #LearnToCode #DeveloperCommunity #ProblemSolving #LinkedInCoding #ViralPost Would you like me to make it sound a bit more casual and story-style (like something that goes viral among students and developers)?
To view or add a comment, sign in
-
-
How I'm Building My DSA Foundation: A Step-by-Step Roadmap A few weeks back, I sat down and made a simple plan to get good at Data Structures & Algorithms once and for all; good, here, meaning actually understand how things work under the hood, not only for cracking interviews. Here's what my roadmap looks like Step 1: Choose ONE Language & Learn the Basics ➡️ Java, C++ ,Python ,C Emphasize syntax, loops, functions, and OOP. Let's not jump between languages - depth > breadth. Step 2: Understand Time & Space Complexities Before solving problems, learn to measure efficiency. Big-O Cheat Sheet https://lnkd.in/dCjiDwTk Step 3: Deep Dive into DSA Concepts Here's my hitlist: Searching & Sorting Divide & Conquer Hashing Computer Algorithms-Greedy Algorithms Recursion & Backtracking Trees & Graphs Dynamic Programming DSA Guide- GeeksforGeeks https://lnkd.in/dCZdNv5b Step 4: Practice Religiously Platforms I use daily: LeetCode https://leetcode.com/ HackerRank https://lnkd.in/d2Y3yWcw CodeWars https://www.codewar.com/ CodeChef https://www.codechef.com/ Codeforces https://lnkd.in/d5R9PKnA Step 5: Compete & Track Growth Join coding contests they're the best reality checks. LeetCode Weekly https://lnkd.in/dnzCt72H CodeChef Contests https://lnkd.in/d7GEAUvs TopCoder https://www.topcoder.com/ ⚡My personal rule: “1 problem a day keeps imposter syndrome away.” Stay consistent. Don’t compare. Keep building. #DSA #CodingJourney #100DaysOfCode #TechLearning #ProblemSolving #SoftwareEngineering #CodeNewbie #Developer
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