Back to Browse

A Subscriber Asked me to solve this Python Question

442 views
Sep 24, 2024
10:20

🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-automations-4579 In this video, I take on a real Python coding challenge submitted by a subscriber! Whether you're preparing for interviews or just love solving problems, this walkthrough will sharpen your skills and show you how to think like a developer. 🚀 Hire me for Data Work: https://ryanandmattdatascience.com/data-freelancing/ 👨‍💻 Mentorships: https://ryanandmattdatascience.com/mentorship/ 📧 Email: [email protected] 🌐 Website & Blog: https://ryanandmattdatascience.com/ 🖥️ Discord: https://discord.com/invite/F7dxbvHUhg 📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan 📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg In this video, I walk through a fascinating Python coding challenge posted in our Discord server about finding the minimum number of binary integers that sum to a given number N. This problem involves working with numbers formed only with zeros and ones (binary representation) and is perfect for Python interview prep and data science problem-solving. I break down the solution into two main parts: first, generating a list of valid binary numbers less than or equal to N, and second, using that list to find the minimum combination that sums to N. The examples I solve include N=32 (using 10, 11, and 11) and N=1043, demonstrating how the algorithm works with both small and large numbers. Throughout the video, I explain key Python concepts including while loops, binary conversion using the bin() function, list manipulation, and conditional logic with if-elif-else statements. I also show you how to optimize the approach by removing numbers from consideration that are too large to be useful. Whether you're preparing for coding interviews, working through Python problems, or building your data science skills, this step-by-step walkthrough will help you understand how to tackle complex algorithmic challenges. Join our free Discord community (link below) to ask your own Python questions and get help from fellow developers! TIMESTAMPS 00:00 Discord Question & Video Introduction 01:00 Understanding the Problem Statement 02:00 Setting Up User Input & Variables 03:00 Building the Number List (Part 1) 04:40 Binary Conversion Explanation 06:00 Summing to Target Number (Part 2) 07:30 Logic for Maximum Values & Count 08:40 Testing & Solution Review 09:40 Join Discord & Closing Thoughts OTHER SOCIALS: Ryan’s LinkedIn: https://www.linkedin.com/in/ryan-p-nolan/ Matt’s LinkedIn: https://www.linkedin.com/in/matt-payne-ceo/ Twitter/X: https://x.com/RyanMattDS Who is Ryan Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF. Who is Matt Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One. *This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.

Download

1 formats

Video Formats

360pmp414.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

A Subscriber Asked me to solve this Python Question | NatokHD