“Kids With the Greatest Number of Candies” from the LeetCode 75 study plan. Problem Idea We are given: candies[i] → number of candies each kid has extraCandies → extra candies we can give to one kid The task is to determine whether a kid can have the greatest number of candies after receiving the extra candies. Approach Find the maximum number of candies any kid currently has. For each kid, add extraCandies. Check if the result is greater than or equal to the maximum. Store True or False in the result list. Complexity Time Complexity: O(n) Space Complexity: O(n) Practicing problems from LeetCode 75 to strengthen my problem-solving and data structures skills. #LeetCode #LeetCode75 #Python #CodingPractice #ProblemSolving #DataStructures
LeetCode 75: Max Candies Problem
More Relevant Posts
-
🐍 Day 3 of brushing up my Python skills! Today was a big one — covered 6 lessons back to back: ✅ Super Keyword — letting the parent run first before the child ✅ Polymorphism — same name, many forms ✅ Practice Problems — Shape, Student, Vehicle, Manager classes ✅ Encapsulation — locking data with __ and using getters & setters ✅ Exception Handling — try, except, else, finally ✅ File Handling — reading, writing and appending files Honestly, encapsulation clicked for me today 💡 Double underscore (__) = lock on a safe 🔒 You need the right key (getter/setter) to open it! Dropping my full notes PDF below for anyone on the same journey 👇 #Python #LearningInPublic #PythonProgramming #OOP #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
Working with data often begins by narrowing things down. Rarely does someone need to look at an entire dataset all at once. Instead, the question is usually more specific: Which transactions were unusually large? Which users joined recently? Which records meet a particular condition? Before any analysis happens, the relevant cases have to be separated from the rest. In data work, this step is essentially a process of filtering. Each record is examined, and only the ones that meet a defined condition are kept. What matters here is not just the rule itself, but the consistency with which it is applied. The same condition must be evaluated across every record. That is where programming becomes useful. Instead of applying the rule manually, the program evaluates it repeatedly and produces the subset that matches the criteria. The dataset remains the same. Only the portion we choose to focus on changes. Day 27 / 30 #30DaysOfDataScience #Python #DataThinking #LearningInPublic
To view or add a comment, sign in
-
-
🐍 Week 17 – Refining My Python Skills 🐍 This was a shorter week due to some personal commitments, but I focused on implementing the quicksort algorithm. Like last week with merge sort, I wanted to deeply understand how quicksort works. Here are the key concepts I worked on: - Implemented a separate partition function to split around a pivot. In my approach, I used three buckets (left, middle, right) to handle duplicates more cleanly and avoid unnecessary comparisons. - Created a quick_sort function to implement the main algorithm, recursively sorting the partitions until the base case was met. After practicing merge sort, quicksort felt more intuitive, and the concepts connected more easily. In Week 18, I plan to practice implementing the Luhn Algorithm. #Python #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
Today I focused first on Python fundamentals that are essential for practical coding: • Functions help organize logic into reusable blocks, making programs cleaner and easier to manage. • Modules allow code reuse and structure, whether importing built-in ones like math or creating custom ones. • File Handling connects programs to external data, enabling reading, writing, and updating files. These basics form the foundation for building larger, real-world applications. Later, I continued with DSA problem-solving and worked through: 1. Intersection of Two Arrays II – practicing frequency maps to handle duplicates. 2. Jump Game II – applying greedy strategies to minimize jumps. 3. Triangle – solving a DP problem to find the minimum path sum from top to bottom. 4. Unique Binary Search Trees – learning how Catalan numbers and DP combine to count BSTs. #Python #DSA #Leetcode #DynamicProgramming #Functions #Modules #FileHandling #CodingJourney #LearningEveryday
To view or add a comment, sign in
-
-
I’ve continued my journey through Python Crash Course (3rd Edition, Eric Matthes) and completed Chapter 5: If Statements. This chapter introduced the power of conditional logic in Python. I practiced: Conditional tests — equality, inequality, numerical comparisons, and Boolean expressions. If statements — simple if, if-else, and if-elif-else chains. Multiple conditions — combining logical checks and omitting the else block when appropriate. Using if statements with lists — checking for special items, ensuring lists aren’t empty, and working with multiple lists. Styling if statements — following clean coding practices for readability and professionalism. Exercises like Alien Colors, Stages of Life, Favorite Fruit, Hello Admin, and Checking Usernames made these concepts practical and engaging. I’ve documented my work and uploaded it to GitHub: https://lnkd.in/dJDD95Vh. Excited to keep building step by step and apply these fundamentals to larger Python projects. Feedback and insights are always welcome! #Python #PythonCrashCourse #Programming #LearningJourney #ConditionalLogic
To view or add a comment, sign in
-
I made myself an invisibility cloak! This was a fun project I created in a few hours with Python. This is the tech I used to build it: → Python 3 → OpenCV → NumPy And here is exactly how it works: 1. Takes 30 frames and creates a clean background image. 2. Converts frames to HSV color space and detects yellow-colored objects. 3. Uses morphological operations to clean up the detection mask. 4. Combines the current frame with the background using bitwise operations. If you are curious to see the code behind it, here is the link to my GitHub repo: → https://lnkd.in/eNziSv9E
To view or add a comment, sign in
-
-
🚀 Excited to share my first mini project — TrendPulse! As part of my learning journey, I built a complete data pipeline using Python. 🔹 Fetched real-time data from HackerNews API 🔹 Cleaned and processed the data 🔹 Performed analysis to identify trends 🔹 Visualized insights using charts This project helped me understand how data flows from raw form to meaningful insights. 📂 Check out my project here: 🔗 GitHub Repo: https://lnkd.in/gYDMHCzV #Python #DataAnalysis #BeginnerProject #LearningJourney #GitHub #MasaiSchool
To view or add a comment, sign in
-
Day 2 of my LeetCode journey 🚀 Today’s problem: Group Anagrams This challenge was all about grouping strings that share the same characters. I approached it using a dictionary + hashing strategy in Python. For each word, I sorted its characters and used that as a key (converted into a tuple), ensuring all anagrams map to the same bucket. Here’s the core logic I implemented: ▪️Traverse the list of strings ▪️Sort each string → convert to tuple → use as dictionary key ▪️Append original string to the corresponding group ▪️Finally, return all grouped values This approach keeps the implementation clean and scalable. Time Complexity: ▪️Sorting each string takes O(k log k) (where k = length of string) ▪️For n strings → O(n * k log k) overall Space Complexity: ▪️O(n * k) for storing grouped anagrams A solid step forward in understanding how hashing + transformations can simplify complex grouping problems. Staying consistent and leveling up daily 💪 #LeetCode #Day2 #Python #DSA #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🔍 Exploring the power of input() and eval() in python Recently, I completed a hands-on Jupyter Notebook focused on understanding Python’s input() function and the use of eval() for dynamic expression evaluation. This practical exercise helped me explore how Python interacts with users and processes real-time data efficiently. Key learnings: 1) Used the input() function to capture user inputs dynamically 2) Understood how input data is treated as strings by default 3) Applied type conversion techniques (int, float) for accurate computations 4) Explored the use of eval() to evaluate mathematical expressions directly from user input 5) Compared typecasting vs eval() for handling different input scenarios This milestone was completed under the guidance of KODI PRAKASH SENAPATI Sir, whose structured and practical approach made these concepts easy to grasp and implement. Continuing to strengthen my Python fundamentals and problem-solving skills step by step 🚀 #PythonProgramming #CodingBasics #PythonBasics #UserInput #EvalFunction
To view or add a comment, sign in
-
Headline: Building a CLI To-Do List Manager with Python! 🐍 I’ve been working on a practical project to sharpen my Python fundamentals: a Command Line Interface (CLI) To-Do List Manager. It’s a simple yet effective way to practice: Looping & Control Flow: Using while True to keep the application active. Data Management: Utilizing Python lists to store, append, and remove tasks. User Interaction: Handling dynamic user input and providing real-time feedback. Error Handling: Implementing logic to catch invalid task selections. There’s something so satisfying about seeing a script come to life in the terminal! Next steps: adding persistent storage so the tasks save to a file. 🚀 #Python #Coding #Programming #ProjectShowcase #LearningToCode #DevCommunity
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