Spring Boot REST Controllers & Grid Partitioning

🚀 #100DaysOfCode – Day 4 Consistency is building up… one concept at a time 💪 ✅ What I accomplished today: 🧠 Spring Boot Learning – REST Controllers & Flow 📌 Key Learnings: Learned about @RestController in Spring Boot → It is a shorthand for @Controller + @ResponseBody → All methods directly return JSON/XML response Understood why using only @Controller is not enough for REST APIs → We need extra configurations, which @RestController simplifies Explored Request Mapping (GET API flow) → How client request hits the controller → How response is returned back Learned about Component Scanning → Spring Boot automatically scans and manages components → Helps in dependency injection & auto-configuration 💻 DSA Practice – Equal Sum Grid Partition 📌 Problem Overview: Given a grid, determine if it's possible to partition it into two parts such that: The sum of both partitions is equal, OR By removing a specific element, the partition can be made equal 📌 Approach: Calculated total sum and maintained two running parts: → topSum and bottomSum Used frequency arrays to track elements in both partitions For every possible split: → Checked if sums are equal → If not, checked whether removing a valid element can balance it Also handled edge cases: → Single row / single column partitions Finally, transposed the grid to reuse logic for vertical splits Submission Link🔗 https://lnkd.in/ewjyGh3N 📌 Key Concepts Used: Prefix-like sum tracking Frequency counting Matrix transformation (transpose) Edge case handling 💡 Reflection: Today was a mix of backend fundamentals + problem-solving Understanding how requests flow in Spring Boot while solving a complex grid problem really helped connect logic with real-world backend thinking. 🔥 Day 4 Done. Moving forward stronger. #SpringBoot #Java #BackendDevelopment #DSA #LeetCode #Consistency #LearningJourney

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories