🚀 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
More Relevant Posts
-
🚀 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
To view or add a comment, sign in
-
-
💻 Mastering Java Through Practice! ☕ Over the past few days, I’ve been diving deep into Java fundamentals by solving 30+ hands-on coding problems — from string manipulation and arrays to matrix operations and logic-based challenges. Each program helped me strengthen my problem-solving mindset and understand how real-world logic translates into code. Here are some key takeaways from this practice: ✅ Understanding how loops, conditions, and string methods work behind the scenes ✅ Writing clean and reusable Java code ✅ Learning the importance of edge cases and user input handling ✅ Gaining confidence with interview-level programs like: 🔁 Reversing strings and sentences 🔢 Counting vowels, digits, and special characters 🧮 Sorting arrays and finding 2nd highest numbers 🔤 Checking anagrams and palindromes 🔄 Rotating matrices clockwise and anticlockwise ✨ Every small project like this builds the foundation for writing efficient and optimized code. 📘 Next goal: Apply these concepts to build Java-based applications (like quizzes, utilities, or small tools). 👉 If you’re also learning Java, start with these kinds of mini-programs — they’re simple but powerful in shaping your logic. #Java #Coding #Programming #DeveloperJourney #LearningByDoing #ProblemSolving #SoftwareEngineering #100DaysOfCode
To view or add a comment, sign in
-
✨ Ever wondered why every Java program begins with public static void main(String[] args)? It’s not just a random line it’s the heart of your Java code! 💻 👉 public makes it visible to the JVM. 👉 static means it runs without creating an object. 👉 void tells Java there’s nothing to return. 👉 main() is the starting point of execution. 👉 String[] args lets you take input from the user. Think of it like pressing START on your program 🚀 That’s when Java knows where to begin running your logic! 💬 Comment below which Java concept you want us to break down next! ❤️ If you liked this post, follow @Crio.Do for more bite-sized Java and coding explainers that make learning fun & simple! #JavaProgramming #LearnJava #CodingBasics #CrioDo #JavaForBeginners #ProgrammersLife #CodeNewbie #SoftwareEngineering #JavaConcepts #PublicStaticVoidMain
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
-
-
💡 Java Calculator – Simple, Functional, and Educational! Developed a Java console-based calculator that supports five core arithmetic operations: addition, subtraction, multiplication, division, and exponentiation. The program validates user input, handles division-by-zero cases, and displays results clearly. ⚙ Features: • Performs +, -, *, /, and ^ operations • Prevents division by zero errors • Simple and readable console output 🧠 Concepts Used: Java Scanner class, switch statement, conditional logic, and math functions 🔧 Tools: Java SE, IntelliJ IDEA / VS Code 🎯 Goal: Strengthen fundamental programming logic and Java syntax through hands-on coding. 🔗 GitHub Repository: https://lnkd.in/g3upWQrk #JavaDevelopment #ConsoleApplication #JavaProjects #Programming #SoftwareEngineering #LearningByDoing #CodingProjects #BeginnerProjects #CodeNewbie #DeveloperJourney #ObjectOrientedProgramming #JavaCommunity
To view or add a comment, sign in
-
🚀 Day 109: Today I Learned About Abstraction in Java Today I explored one of the core pillars of Object-Oriented Programming — Abstraction. 🔍 What is Abstraction? Abstraction means showing only the essential details and hiding the complex internal logic. Just like how we use a phone without knowing how the internal circuits work — in programming, abstraction helps us focus on what something does, not how it does it. 💡 Why is it useful? Makes code cleaner and easier to understand Hides unnecessary complexity Improves security by exposing only required features Helps in building scalable and maintainable systems 🧩 In Java: We achieve abstraction using: Abstract Classes Interfaces ✨ Learning abstraction helped me understand how real-world systems hide complexity and provide simple interfaces for users. Excited to dive deeper into OOP concepts! 🔥 #Java #OOPs #Abstraction #LearningInPublic #100DaysOfCode #Day109 #CodingJourney
To view or add a comment, sign in
-
-
After understanding why Java is important, today I explored the absolute basics — 👉 What is a Program? A set of instructions to solve a real-world problem. 👉 What is Programming? The skill of writing those instructions effectively. But here’s the real eye-opener 💡 Programming isn’t just about writing code — it’s about fixing errors! If I want my code to run smoothly, I first need to identify its three biggest enemies: ⚙️ 1. Compile Time Error (The Grammar Check) Occurs before execution. It’s all about syntax mistakes — missing semicolons, misspelled keywords, etc. 💡 Compiler (like javac) catches these right away — so always pay attention to syntax! 💥 2. Runtime / Execution Error (The Unexpected Crash) Happens during execution. Your code is syntactically correct, but something unexpected happens — dividing by zero, accessing invalid indexes, etc. These usually trigger Exceptions. 🧠 3. Logical Error (The Silent Killer) The hardest one to spot. Your program compiles and runs but gives wrong results — because your logic is flawed. 🎯 My Takeaway: Understanding these errors helps me structure my testing process better and build stronger debugging habits. 💬 Which of these errors frustrated you the most when you were learning Java? Share your war stories below! 👇 #Java #ProgrammingBasics #CoreJava #LearningJourney #QSpiders #JSpiders #CompileTimeError #RuntimeError #LogicalError #SineshBabbar
To view or add a comment, sign in
-
-
💻 Understanding public static void main(String[] args) in Java Every Java program starts its journey from this line — but do you know what each word really means? Let’s break it down 👇 public → The method is accessible from anywhere. The JVM needs to access this method to start your program. static → Belongs to the class, not an object. So the JVM can call it without creating an object. void → It doesn’t return any value. Once the execution is done, the program just ends. main → The entry point of every Java program. Execution starts from here. String[] args → Used to take command-line arguments. You can pass inputs while running your program. #Java #Programming #Coding #CodeWithPassion #Java Grateful to my mentor Anand Kumar Buddarapu Sir for constantly motivating us to learn and grow in our coding journey. 🌱 Thanks to Codegnan Saketh Kallepu Sir Uppugundla Sairam Sir
To view or add a comment, sign in
-
-
🚀Day 97/100 #100DaysOfLeetCode 👩💻Problem: Valid Square✅ 💻Language: Java 💡Approach: To check if four given points form a valid square, I calculated all six pairwise distances between the points. 🔹A valid square must have two distinct distances — 4 equal smaller sides and 2 equal longer diagonals. 🔹Used a HashMap to count occurrences of each distance. 🔹If the map has exactly two distinct non-zero distances and the smaller one appears 4 times while the larger appears 2 times, it’s a square! 🧠Key Takeaways: 🔹Strengthened understanding of geometry-based problems. 🔹Reinforced hashing techniques for quick frequency checks. 🔹Improved logic for pairwise comparison and distance calculation. ⚙️Performance: ⏱️Runtime: 2 ms (Beats 27.27%) 💾Memory: 41.91 MB (Beats 22.03%) #100DaysOfLeetCode #Java #CodingChallenge #LeetCode #ProblemSolving #CodingChallenge
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