Solving Hostel Struggles with Code: The Bill Splitter 💸💻 Day 42/100 Real-world problems require real-world logic. 🏗️ For Day 42, I decided to build something every college student needs: an Automated Expense Splitter. No more awkward math after a group dinner just clean, object-oriented logic. Technical Highlights: 📊 Cumulative Aggregation: Managing a running total of expenses across multiple class methods. 📐 Dynamic Division: Using Python’s len() function to calculate shares based on a fluctuating number of participants. 📉 Float Formatting: Implementing string formatting (:.2f) to ensure financial data is presented with professional precision. The Impact: Programming isn't just about complex algorithms; it's about making life simpler. Whether it's splitting a dinner bill or managing a corporate budget, the core logic of 'Distributed Costs' is a fundamental skill in software development. Do chech my GitHub repository here : https://lnkd.in/d9Yi9ZsC #Python #100DaysOfCode #BTech #FinTech #HostelLife #SoftwareEngineering #CleanCode #LearningInPublic #EngineeringStudent #WomenInTech
Automated Expense Splitter for College Students
More Relevant Posts
-
🚀 LeetCode Win: Rearranging Array Elements by Sign Solved the problem “Rearrange Array Elements by Sign” today and wanted to share the thought process behind my solution. 🔹 Problem Overview Given an array with equal numbers of positive and negative integers, the task is to rearrange it so the elements alternate between positive and negative, starting with a positive number. 💡 My Approach Instead of handling complex index manipulation directly, I simplified the problem into two clear steps: 1️⃣ Separate the elements I first traversed the array once and grouped the numbers into two lists: one containing all the positive numbers one containing all the negative numbers This step also ensures that the relative order of elements remains unchanged. 2️⃣ Rebuild the array alternately Since the count of positive and negative numbers is equal, I then constructed the final array by alternately placing: one positive number one negative number This results in a sequence like: positive → negative → positive → negative ⚙ Complexity • Time Complexity: O(n) • Space Complexity: O(n) 📌 This problem reinforced an important lesson: Sometimes the cleanest solution comes from breaking the problem into smaller logical steps rather than forcing a complex one-pass trick. Consistently practicing DSA and problem-solving one challenge at a time. 💻✨ #LeetCode #DSA #Python #ProblemSolving #CodingJourney #SoftwareEngineering #WomenInTech #LearningInPublic
To view or add a comment, sign in
-
-
LeetCode Win Today 🚀 Solved “Apply Operations to an Array” with a simple two-pass approach. ⚡ Runtime: 0 ms (Beats 100%) Approach: 🔹 Pass 1: Traverse the array If nums[j] == nums[j-1] → Double the left element → Set the right element to 0 🔹 Pass 2: Move all zeros to the end using a two-pointer technique. 💡 Key Insight: Instead of solving everything in one complex loop, split the problem into two clean steps. 📊 Complexity: • Time → O(n) • Space → O(1) (in-place) Consistent practice. Clear thinking. Better code every day. 🧠⚡ #leetcode #dsa #algorithms #datastructures #coding #programming #python #softwareengineering #computerscience #tech #codinglife #problem-solving #100daysofcode #developers #codingjourney #techcommunity 🚀
To view or add a comment, sign in
-
-
✔️ #Day43 of #DSA LeetCode Journey ⛓️💥 🚀 LeetCode #1672 – Richest Customer Wealth | Python Solution Solved an interesting beginner-friendly problem today! 🔹 Problem Statement: Given an m x n grid where accounts[i][j] represents money in the jᵗʰ bank of the iᵗʰ customer, return the wealth of the richest customer. 👉 A customer's wealth = sum of money in all their bank accounts. 👉 We need to return the maximum wealth among all customers. 🧠 Approach: Calculate the sum of each row (customer wealth). Return the maximum row sum. ⏱ Time Complexity: O(m × n) — We visit each element once. 📦 Space Complexity: O(1) — No extra space used. ✨ Key Learning: Even simple problems test your understanding of loops, 2D arrays, and built-in functions like sum() and max(). Small problems build strong foundations 💪 #LeetCode #Python #CodingPractice #ProblemSolving #50DaysOfCode #Learning #PlacementPreparation 10000 Coders Manoj Kumar Reddy Parlapalli
To view or add a comment, sign in
-
-
Just wrapped up Advent of Code 2025 — a little late, but fully complete. 🎄 💫 For those unfamiliar, Advent of Code is a Christmas-themed December coding challenge where each day unlocks a new problem that pushes your problem-solving, algorithms, and debugging skills. I solved the challenges in Python. Some solutions were entirely my own, while for a few I explored community approaches and online solutions to understand different ways of thinking. That, honestly, was one of the most valuable parts — seeing how the same problem can be modeled, optimized, and expressed differently. What I gained from this: - Sharpened problem decomposition skills - Practiced writing cleaner, more efficient code - Revisited data structures and algorithmic thinking Advent of Code is a reminder that deliberate practice compounds. 25 small problems → noticeably better intuition. If you're considering it next year — I highly recommend it! https://lnkd.in/diqJMrYD
To view or add a comment, sign in
-
-
Today I worked on Codédex Daily Challenge #17, a Python problem focused on decision-making under constraints. The challenge was to choose the best flight voucher based on the highest dollars-per-hour-delayed ratio, while excluding any option that exceeded the maximum waiting time. At first, the solution looked straightforward: Iterate through each option, calculate the ratio, and keep the best one. But while testing the code, I found an important edge case. My initial implementation initialized best_ratio = 0, which caused a bug when I tested inputs where all valid voucher values produced a ratio of 0. In that situation, the code returned -1 instead of returning the first valid option, even though the problem statement specified that ties should return the first one. That small error reinforced a valuable lesson: writing code is not only about solving the main case, but also about identifying boundary conditions and making sure the logic holds under all valid inputs. From a computational perspective: Time complexity: O(n) — each option is evaluated once Space complexity: O(1) — only a few tracking variables are needed What I like about challenges like this is that they reflect real-world thinking: we are often comparing value, time, and constraints to make better decisions. This kind of logic can easily connect to: cost-benefit analysis prioritization models scoring systems operational decision-making analytics-driven recommendations A simple bug, but a very real reminder: edge cases matter. #Python #ProblemSolving #Debugging #DataAnalytics #Optimization #CodeDex #ContinuousLearning
To view or add a comment, sign in
-
-
🚀 Day 6 of My Daily Coding Challenge Solved LeetCode 1545 – Find Kth Bit in Nth Binary String today. At first, it looks like a string construction problem. But building the full string would be inefficient since its length grows exponentially (2ⁿ - 1). 💡 Key Insight: The string follows a recursive pattern: Left half → S(n-1) Middle → always '1' Right half → reverse + invert of S(n- 1) Instead of constructing the string, I used recursion and symmetry: If k is in the left half, then solve for n-1 If k is the middle, then the answer is '1.' If k is in the right half, mirror the position and invert the result This approach reduces the problem to O(n) time instead of exponential. What I learned today: Don’t simulate when math/pattern recognition can solve it. Recursive structure often hides optimization opportunities. Understanding the pattern is more powerful than brute force. Day 6 done. Staying consistent 🔥 On to Day 7. #LeetCode #DailyChallenge #Python #Recursion #ProblemSolving #CodingJourney #Consistency
To view or add a comment, sign in
-
-
Day 49 – Making a Slow Algorithm Faster 🚀 Yesterday (Day 48) I explored a problem that many beginners run into in programming. The task was simple: Given a list of numbers, find all pairs that add up to a target value. The first solution I learned used nested loops. This meant every number was compared with every other number. Example thinking process: Take the first number Compare it with every other number Move to the second number Compare it with every other number again This works… but there’s a problem. If the list has n numbers, the algorithm checks roughly n × n combinations. This makes the algorithm O(n²). That means as the data grows, the program slows down very quickly. So How Do We Make It Faster? Instead of comparing every number with every other number, we can remember numbers we’ve already seen. This is where a set (or dictionary) becomes very useful. The idea becomes: Go through the list once For each number, calculate the number needed to reach the target Check if that number already exists in our set If it does → we found a pair If it doesn’t → store the current number and continue Now instead of comparing every number with every other number, we only loop once through the list. This reduces the complexity from: O(n²) → O(n) Which is a huge performance improvement. Why This Matters in Real Systems Imagine this logic inside: A payment system A recommendation engine A social media feed A large API handling thousands of requests If the algorithm is inefficient, the system becomes slow, expensive, and hard to scale. Good engineers don't just solve problems. They solve them in the most efficient way possible. Today's Lesson The biggest lesson today was learning that: The right data structure can transform a slow algorithm into a fast one. And that’s exactly why data structures and algorithms are the foundation of software engineering. #Day49 #Algorithms #DataStructures #BigO #Python #SoftwareEngineering #BackendDevelopment #LearningInPublic
To view or add a comment, sign in
-
🔥 Day 54 of #100DaysOfCode 📌 Solved: Sort an Array (LeetCode 912) Today’s problem was all about mastering sorting fundamentals without using built-in functions — a real test of understanding core algorithms. 💡 Problem Insight: We are given an array of integers and need to sort it in ascending order with O(n log n) time complexity. 👉 This rules out simple approaches like Bubble Sort or Selection Sort ❌ 👉 Forces us to use efficient algorithms like: ✔️ Merge Sort ✔️ Quick Sort ⚙️ Approach I Used: Merge Sort 🔹 Divide the array into halves 🔹 Recursively sort both halves 🔹 Merge them in sorted order 🚀 Key Learnings: ✅ Divide & Conquer strategy ✅ Importance of time complexity ✅ Writing sorting logic from scratch (no shortcuts!) ✅ Handling edge cases while merging arrays 📊 Result: ✔️ Accepted ✅ ⏱️ Runtime: 999 ms 💾 Memory: Optimized #Day54 #LeetCode #DSA #Python #CodingJourney #100DaysOfCode #ProblemSolving #Tech #Developers #Learning
To view or add a comment, sign in
-
-
Starting as a small holiday project in 1989, Python has grown into a key tool widely used in AI, web development and data science, making it a foundation of modern computing. 🐍 In our latest article, Anton Gurkovsky, Technical Architect at Pwrteams Ukraine, explores how Guido van Rossum’s vision for a readable, practical language grew into one of the most influential tools in tech, all while staying true to its philosophy: clarity, simplicity and elegance. Discover how a side project evolved into a global technology standard that continues to shape the future of software development. 🔗 Link in the comments below. #Python #Programming #TechInnovation #SoftwareDevelopment #DataScience
To view or add a comment, sign in
-
-
Day 15/100: Stepping into Intermediate Python - The Coffee Machine Project! Today marks the start of the "Intermediate" phase in my #100DaysOfCode journey. I moved away from simple games to building a functional simulation of a real-world machine. Why Day 15 was different: Instead of just "input/output," I had to manage a System State. The program needs to remember how much water, milk, and coffee is left after every transaction. Key Features I Implemented: Resource Management: Checking if ingredients are sufficient before taking an order. Coin Processing: Calculating totals from Quarters, Dimes, Nickels, and Pennies (precise decimal math!). Transaction Logic: Handling payments, providing change, and updating the machine's "profit" ledger. Report Generation: A special command to see the current status of all resources. I'm now building logic that mirrors how real hardware software works. Onward to Object-Oriented Programming (OOP) tomorrow! Check out my Day 15 code here: https://lnkd.in/gAG6a6qU #Python #VSCode #100DaysOfCode #SystemDesign #SoftwareDevelopment #ProgrammingJourney
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
Great Kashish Bajaj