🚀 Day 4 of #100DaysOfCode Today I focused entirely on strengthening decision-making logic using conditional statements in Java. 📌 Problems Implemented: • Check if a number is positive, negative, or zero • Check if a number is odd or even • Find the greatest of three numbers • Determine whether a year is a leap year • Grade calculator based on marks • Categorize age groups (Child, Teen, Adult, Senior) 🔎 Core Focus: Today was about mastering nested if-else logic and building structured conditional flows. 💡 Key Learnings: • Writing clean multi-branch conditions • Handling edge cases in leap year logic (divisible by 4, 100, 400) • Structuring readable comparison logic • Avoiding overlapping conditions Strong logic is the backbone of DSA and backend development. #Java #Programming #LogicBuilding #SoftwareEngineering #Consistency #100DaysOfCode #LearningInPublic #CodingJourney #FullStackDeveloper
Strengthening Decision-Making Logic in Java
More Relevant Posts
-
🚀 Day 59 of #100DaysOfCode Today I worked on a classic problem: Converting Time into Words (C Programming) ⏰ It sounds simple — but it really tests your: ✅ Conditional logic ✅ Edge case handling ✅ String formatting ✅ Problem understanding For example: 5:47 → thirteen minutes to six 3:00 → three o' clock 7:15 → quarter past seven This problem reminded me that: 👉 Clean logic > Complex logic 👉 Edge cases matter a lot 👉 Small problems improve big thinking As a developer, mastering fundamentals in C strengthens problem-solving skills for any language — whether it’s JavaScript, Java, or backend development. Consistency is the real power. 59 days done. Still building. 💪 #Day59 #100DaysOfCode #CProgramming #ProblemSolving #CodingJourney #DeveloperGrowth #Consistency
To view or add a comment, sign in
-
Back on track after a short health break — consistency continues 💪 Day 12 of #100DaysOfCode 🚀 👉 LeetCode #15 – 3Sum (Medium) This problem really tests how well you can optimize brute-force thinking into an efficient solution. 🔹 Approach: First, sort the array Fix one element at a time Use two pointers (left & right) to find pairs with sum -nums[i] Carefully skip duplicates to avoid repeated triplets ⏱ Complexity: Time: O(n²) Space: O(1) (excluding output) 📌 Key Learnings: Sorting can simplify complex problems Two-pointer technique shines after sorting Handling duplicates is as important as core logic Medium problems demand clarity + patience, not shortcuts 💡 Takeaway: Optimization isn’t about writing less code — it’s about thinking smarter, step by step. Building strong DSA fundamentals in Java, one problem at a time. #LearnInPublic #DSA #Java #LeetCode #TwoPointers #ProblemSolving #CodingJourney #SoftwareEngineering #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 LeetCode 151 Challenge – Day 8 🚀 Progress isn’t about solving many problems in one day — it’s about solving one problem every day consistently 💪 🔹 Goal: Solve 151 LeetCode problems 🔹 Focus: DSA fundamentals + optimized approaches 🔹 Language: Java 🔹 Day: 8 ✅ ✅ Today’s Problem: 35. Search Insert Position (Easy) 🔍 Approach: – Applied Binary Search on a sorted array – Compared target with middle element – Adjusted left and right pointers accordingly – Returned correct insert position if target not found ⏱ Time Complexity: O(log n) 📦 Space Complexity: O(1) This problem reinforces a key interview concept: 👉 Whenever you see a sorted array + O(log n) requirement, think Binary Search immediately. 💬 Quick question: Can Binary Search be applied to problems beyond arrays? Where else have you used it? Let’s keep building strong fundamentals 👇 #LeetCode #DSA #ProblemSolving #Java #BinarySearch #Consistency #CodingJourney #SoftwareEngineering #LearningEveryDay #100DaysOfCode
To view or add a comment, sign in
-
-
✨DAY-16: 💻 From Messy Variables to Clean Arrays – The Power of Smart Coding! This meme perfectly shows the difference between writing code without arrays and using arrays in Java. 🔴 Without Arrays: Java Copy code int mark1 = 86; int mark2 = 71; int mark3 = 90; int mark4 = 65; 👉 Too many variables 👉 Hard to manage 👉 Not scalable 👉 Messy and inefficient Imagine handling 100 student marks like this 😅 🟢 With Arrays: int[] marks = {86, 71, 90, 65, 79}; ✅ Organized ✅ Easy to access using index ✅ Simple to loop ✅ Clean and scalable Arrays help us store multiple values of the same type in a single variable, making our code structured and efficient. 📌 Daily Life Lesson: When things are unorganized, life feels stressful. When structured properly, everything becomes simple and productive. Learn concepts clearly — code smarter, not harder 🚀 #Java #Programming #Arrays #CodingLife
To view or add a comment, sign in
-
-
🚀 Day 14 of My LeetCode Journey Today I solved an interesting problem on LeetCode: “Check if Binary String Has at Most One Segment of Ones.” 🧠 Problem Statement: Given a binary string, check whether it contains at most one continuous segment of '1's. 📌 Example: Input: "111000" → ✅ True Input: "110011" → ❌ False 💡 Key Idea: If the string contains "01", it means the sequence of `1`s ended and `0`s started. If another `1` appears later, there are multiple segments of `1`s, which makes the answer false. 🎯 Learning: Many coding problems become easier when we look for patterns instead of writing complex logic. Consistency is the key to improving problem-solving and programming skills. #LeetCode #Java #CodingJourney #ProblemSolving #100DaysOfCode #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 133 of #1000DaysOfCode LeetCode Daily Challenge — Day 57 57 consecutive days. Consistency is no longer effort — it’s routine. Today’s challenge focused on binary simulation and carry propagation — optimizing the number of steps required to reduce a binary string under defined operations. ⚡ Runtime: 0 ms — Beat 100% Key takeaways: • Strengthened understanding of binary arithmetic simulation • Improved carry handling logic during reverse traversal • Practiced writing efficient linear-time solutions • Continued refining clean and minimal Java implementation ✔️ Accepted solution 🔁 57-Day Coding Streak The biggest change after 50+ days? Problems feel structured. Patterns feel familiar. Execution feels faster. Onward to 60 days. 🚀 #LeetCode #Consistency #Algorithms #DataStructures #Java #BitManipulation #ProblemSolving #100Percentile #SoftwareEngineering #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 8 – LeetCode Practice Today, I solved the Count and Say problem on LeetCode: 🎯 Difficulty: Easy / Medium 💻 Language Used: Java 💡 Approach: • The “count and say” sequence is built by reading off digits of the previous term — counting repeated digits then describing them. • I started from the base term "1" and iteratively built the next term by scanning the current string and describing consecutive runs of the same character. • This continues until the nth term is generated. ⏱ Complexity: • Time Complexity: O(n × k) (n = sequence length, k = average term length) • Space Complexity: O(k) 📚 Key Takeaway: This problem improved my understanding of string manipulation and iterative pattern construction. Carefully building and transforming sequences is a useful technique in many real-world problems. Consistent problem-solving practice continues to strengthen my logic and coding confidence 💪 #LeetCode #Java #DSA #Strings #ProblemSolving #Algorithms #CodingPractice #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 132 of #1000DaysOfCode LeetCode Daily Challenge — Day 56 56 days. Zero breaks. Steady execution. Today’s problem revolved around custom sorting logic using bit manipulation — ordering integers based on the number of set bits with a well-structured comparator. Key takeaways: • Strengthened understanding of custom comparator design • Applied bitCount effectively within sorting logic • Reinforced hybrid thinking: bit manipulation + sorting • Improved clarity in writing clean and optimized Java solutions ✔️ Accepted solution 🔁 56-Day Coding Streak At this stage, pattern recognition is becoming faster. Less hesitation. More structure. Cleaner implementation. Onward to 60 days. 🚀 #LeetCode #Consistency #Algorithms #DataStructures #Java #BitManipulation #Sorting #ProblemSolving #SoftwareEngineering #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 3 – LeetCode Practice Today, I solved the Longest Common Prefix problem on LeetCode: 🎯 Difficulty: Easy 💻 Language Used: Java 💡 Approach: • Given an array of strings, the task was to find the longest common prefix shared among all strings. • I assumed the first string as the prefix and compared it with each subsequent string. • While characters matched, I kept shortening the prefix when mismatches occurred. • This simple iterative check helped determine the common prefix efficiently. ⏱ Complexity: • Time Complexity: O(n × m) (where n = number of strings, m = length of the shortest string) • Space Complexity: O(1) 📚 Key Takeaway: This problem reinforced my understanding of string traversal, comparison logic, and how to efficiently reduce search space through early termination. Consistent problem-solving practice continues to build my confidence and coding fundamentals. 💪 #LeetCode #Java #DSA #Strings #ProblemSolving #Algorithms #CodingPractice #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 4 – LeetCode Practice Today, I solved the Valid Parentheses problem on LeetCode: 🎯 Difficulty: Easy 💻 Language Used: Java 💡 Approach: • Given a string containing just the characters ()[]{}, the task was to check whether the input string is valid — meaning every opening bracket has a matching closing bracket in the correct order. • I used a stack to match brackets: – When encountering an opening bracket, push it onto the stack. – When encountering a closing bracket, check whether the top of the stack matches the corresponding opening type. – At the end, if the stack is empty, all brackets matched correctly. ⏱ Complexity: • Time Complexity: O(n) • Space Complexity: O(n) 📚 Key Takeaway: This problem helped reinforce stack usage and careful handling of matching pairs — a foundational technique for many parsing and syntax-checking problems. Consistent problem-solving practice continues to build my confidence and coding fundamentals. 💪 #LeetCode #Java #DSA #Stack #ProblemSolving #Algorithms #CodingPractice #100DaysOfCode #SoftwareDeveloper
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