🚀 LeetCode Problem Solving in Java 💡 Problem: Height Checker The challenge was to determine how many students are standing out of order compared to the expected (sorted) arrangement of their heights. 🧠 Approach: I copied the original array, sorted it, and compared both arrays element by element to count the mismatched positions. This helped identify how many students are not in the correct place. 📈 Concepts Used: Array manipulation Sorting Comparison and mismatch counting 🔥 Consistently solving such problems is improving my logical thinking, debugging skills, and efficiency in writing clean Java code. #LeetCode #JavaProgramming #ProblemSolving #CodingJourney #DSA #100DaysOfCode #JavaDeveloper
Solved LeetCode Height Checker problem in Java
More Relevant Posts
-
🚀 Day 27 of 100 Days of LeetCode 📘 Problem: Generate Parentheses 💻 Language: Java ✅ Status: Accepted — Runtime: ⚡ 0 ms (Beats 100%) Today’s challenge focused on backtracking, one of the most elegant and powerful problem-solving techniques in DSA. The task was to generate all possible valid combinations of parentheses — a perfect test of recursion and logical constraints 🧩 ✨ Key Learnings: Backtracking is about exploring all possibilities, then undoing choices when needed 🔄 Understanding base cases clearly makes recursion much easier Clean recursive structures lead to elegant and efficient solutions This problem reinforced one important principle — 🧠 “Sometimes, going back is the only way to move forward — both in code and in life.” #Day27 #100DaysOfCode #LeetCode #Java #Backtracking #Recursion #ProblemSolving #CodingJourney #DSA #SoftwareDevelopment #KeepLearning #CodeEveryday
To view or add a comment, sign in
-
-
🚀 Java Min-Max Sum Challenge | Speed Coding Practice Today, I practiced an interesting Java problem that helped me strengthen my understanding of loops, arrays, and basic algorithmic logic. 🧩 Problem Statement: Given an array of n integers, find the minimum and maximum sums that can be obtained by adding exactly n−1 elements. In simple terms — for each element, calculate the sum of all other elements and then print the smallest and largest of those sums. Example: Input → 1 2 3 4 5 Output → 10 14 This exercise really helped me: Improve my logic-building and problem decomposition skills 🧠 Practice nested loops and array traversal in Java 🔁 🎥 I’ve attached a short speed coding video of my implementation — showcasing how I approached, reasoned, and wrote the code step-by-step. I’m enjoying learning Java by solving such small but powerful logic-based problems every day! #Java #CodingPractice #ProblemSolving #ProgrammingJourney #LearningToCode #LinkedInCodingCommunity
To view or add a comment, sign in
-
📢 Core Java Series – Day 4: How Java Program Runs (Step by Step) Ever wondered what happens when you run a Java program? In this short 1-minute video, I’ve explained — 🔹 How Java code is written, compiled, and executed 🔹 The role of Compiler, Bytecode, and JVM 🔹 Why Java is called “Write Once, Run Anywhere” This video is perfect for beginners and students learning Core Java or preparing for interviews. Watch now 🎥 https://lnkd.in/gzaRJhUt Follow Code_Logic_Hub for daily 60-sec shorts on Java, Computer Fundamentals & CS concepts! 🚀 #Java #Learning #Programming #SoftwareDevelopment #ComputerScience #CodeLogicHub #CoreJava
To view or add a comment, sign in
-
💻 Day 17 – Inheritance in Java & Type Casting Explained Today I learned how inheritance works in Java and how parent–child relationships affect what properties and methods we can access. 👇 🧩 Object Creation Possibilities ✅ Can I create Parent class object? → Yes ✅ Can I create Child class object? → Yes 🧠 Scenarios: * Child ref = new Child(); → Possible * Can access Child and Parent properties. If a method is overridden, the Child version executes. * Parent ref = new Parent(); → Possible * Can access only Parent properties. No access to child class members. * Parent ref = new Child(); → Possible (Upcasting) * Can access only Parent properties (Child’s are hidden). If overridden, the Child method runs at runtime → Dynamic Polymorphism. * Child ref = new Parent(); → ❌ Not Possible Gives a compile-time error. Even with downcasting, it leads to ClassCastException at runtime. 🎯 Type Casting in Java Type Primitive Non-Primitive Implicit Widening Upcasting Explicit Narrowing Downcasting 🔍 Key Takeaways: Upcasting is safe (Parent ← Child). Downcasting needs caution — can cause runtime exceptions. Overridden methods always execute from the Child class, even if the reference is of Parent type. 10000 Coders #Java #OOPs #Inheritance #TypeCasting #JavaLearning #100DaysOfCode #Day17 #CodingJourney
To view or add a comment, sign in
-
-
This PDF serves as a complete roadmap to learning Core Java, covering both foundational and advanced topics in a structured, easy-to-understand format. It explains key concepts like classes, objects, constructors, inheritance, polymorphism, encapsulation, and abstraction, while also exploring interfaces, packages, access modifiers, and exception handling with practical examples. The guide also includes Java coding standards, naming conventions, and interview-focused questions, helping learners strengthen both theoretical knowledge and coding discipline. Ideal for students, developers, and interview aspirants, this resource builds a solid understanding of how Java works—from the basics of "main()" and "static" blocks to deeper insights into JIT compiler, bytecode, and platform independence. A must-read for anyone aiming to become proficient in Java programming! #Java #CoreJava #Programming #TechLearning #JavaDevelopers #Coding
To view or add a comment, sign in
-
This PDF serves as a complete roadmap to learning Core Java, covering both foundational and advanced topics in a structured, easy-to-understand format. It explains key concepts like classes, objects, constructors, inheritance, polymorphism, encapsulation, and abstraction, while also exploring interfaces, packages, access modifiers, and exception handling with practical examples. The guide also includes Java coding standards, naming conventions, and interview-focused questions, helping learners strengthen both theoretical knowledge and coding discipline. Ideal for students, developers, and interview aspirants, this resource builds a solid understanding of how Java works—from the basics of "main()" and "static" blocks to deeper insights into JIT compiler, bytecode, and platform independence. A must-read for anyone aiming to become proficient in Java programming! #Java #CoreJava #Programming #TechLearning #JavaDevelopers #Coding
To view or add a comment, sign in
-
Day 9 at TAP Academy: Exploring Subarrays, Sliding Window Techniques & Java Strings Today's journey involved understanding powerful techniques to handle arrays and an introduction to strings in Java, crucial for efficient coding and problem-solving. 🔹 Subarrays and Sliding Window Fixed-length and variable-length subarrays help break down problems into manageable pieces. Learned to find the longest consecutive subarray, a common algorithmic challenge. Implemented programs using sliding window techniques to optimize consecutive subarray operations. 🔹 String Introduction in Java Explored various ways to create strings in Java, including literals and using constructors. Gained insights into how strings are stored in memory, recognizing string pool and immutability concepts. Mastering these concepts sharpens coding skills and builds a strong foundation in both array handling and string manipulation. #TAPAcademy #Day9 #JavaLearning #Subarrays #SlidingWindow #JavaStrings #CodingFundamentals #TechLearning #ProgrammingSkills
To view or add a comment, sign in
-
-
Hii Connections 👋 Today I solved an interesting String problem in Java: Problem: Find the length of the longest substring without repeating characters. My Approach: I used the sliding window technique along with a Hashtable to track the last seen index of each character. Here’s the logic: Move a window through the string using two pointers (start and end). If a character repeats, move the start pointer just after the last occurrence of that character. Keep updating the maximum length (max) as the window expands. This approach efficiently solves the problem in O(n) time, avoiding unnecessary re-checks of characters. What I Learned: ✅ Sliding window works great for substring problems. ✅ Hashtable helps efficiently manage character indices. ✅ Optimization is often about tracking what you already know, not recalculating it. Another step forward in mastering DSA and pattern-based problem solving 💪 #Java #DSA #ProblemSolving #Coding #SlidingWindow #LeetCode #LearningEveryday
To view or add a comment, sign in
-
-
📐 Java Hypotenuse Calculator – Quick Geometry in Action! Built a simple yet efficient Java console application that calculates the hypotenuse of a right-angled triangle using the Pythagorean theorem. This project helped me practice user input handling, mathematical operations, and output formatting in Java. ⚙️ Features: • Accepts side lengths A and B as user input • Calculates the hypotenuse C using Math.sqrt() and Math.pow() • Displays the result with two-decimal precision 🧠 Concepts used: Scanner class, Java Math library, and basic geometry 🔧 Tools in use: Java SE, IntelliJ IDEA / VS Code 🎯 Goal: Strengthen Java fundamentals while applying mathematical logic to real-world problems GitHub: https://lnkd.in/dUJEkMPg #JavaDevelopment #JavaProjects #ConsoleApplication #SoftwareEngineering #CodingProjects #Programming #LearningByDoing #BeginnerProjects #CodeNewbie #DeveloperJourney #ObjectOrientedProgramming #JavaCommunity
To view or add a comment, sign in
-
🚀 Day 29 of 100 Days of LeetCode 📘 Problem: Combination Sum 💻 Language: Java ✅ Status: Accepted — Runtime ⚡ 2 ms (Beats 86%) Today’s problem was all about backtracking — exploring all possible combinations to reach a target sum. It’s a perfect blend of recursion, decision-making, and pruning unnecessary paths 🧠 ✨ Key Learnings: Backtracking is like exploring a maze — try, backtrack, and try again until you find the exit 🌀 Each recursive call represents a “choice point” — include or skip the element Clean recursion with controlled base cases leads to clarity and precision This problem reminded me how persistence works in both code and life: 💬 “Sometimes, the path to the solution is not straightforward — you just need to keep exploring.” #Day29 #100DaysOfCode #LeetCode #Java #Backtracking #Recursion #DSA #ProblemSolving #CodingJourney #SoftwareDevelopment #KeepLearning #CodeEveryday
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
Congratulations Ravi