🚀 Day 13 of Consistency | LeetCode Grind Continues 💪 Today I solved “Concatenation of Consecutive Binary Numbers” on LeetCode. At first glance, the problem looks simple — just concatenate binary representations from 1 to n. But the challenge is handling the huge number efficiently and returning the result modulo 10^9 + 7. 🔎 Key Learning Today: Instead of building a massive binary string (which would be inefficient), we can simulate concatenation using bit manipulation. 💡 The trick: Appending a number in binary = left shift the current result by the number of bits in that number. Add the number. Take modulo at every step. The bit length increases only when the number becomes a power of 2 (i & (i-1) == 0). This converts a potentially expensive string problem into a clean O(n) mathematical solution. 📊 Complexity: Time → O(n) Space → O(1) Small optimizations. Big impact. 🔥 Consistency > Motivation. On to Day 14 🚀 #Day13 #LeetCode #100DaysOfCode #DSA #Java #Python #Cplusplus #CodingJourney #BitManipulation #SoftwareEngineering
LeetCode Day 13: Concatenation of Consecutive Binary Numbers
More Relevant Posts
-
Day 12. Two sorting algorithms and two classic Hard problems. 🔥 Topic of the day : Selection Sort Insertion Sort Then the 6 practice problems hit different. First three are standard LeetCode Mediums. But then we introduced something new — Binary Search on the Answer. Aggressive Cows. Book Allocation. These are the problems where you're not searching for an element. You're searching for the best valid answer. You ask: "Is X possible?" for each candidate X. If valid answers are monotone, binary search applies. This unlocks an entire class of Hard problems — Painter's Partition, Koko Eating Bananas — Split Array Largest Sum — Same template — different feasibility function. 12 days in. The problems are getting harder. The people still here are the ones who'll make it to the end. 📂 https://lnkd.in/g2yF6JAb 💬 Community → https://lnkd.in/g57zJcsJ 📸 https://lnkd.in/gajv9hE4 #DSAChallenge #SelectionSort #InsertionSort #Sorting #BinarySearch #DSA #Java #Python #CPlusPlus #LeetCode #100DaysOfCode #Week2 #CodingCommunity
To view or add a comment, sign in
-
-
🚀 Day 61 of #100DaysOfCode 🧩 Problem: Word Break (LeetCode 139) Today’s problem was all about Dynamic Programming + String Matching. 💡 Problem Statement: Given a string "s" and a dictionary of words "wordDict", determine if "s" can be segmented into a space-separated sequence of one or more dictionary words. --- 🔍 Approach: Instead of checking all possible combinations (which is expensive), I used Dynamic Programming: ✔️ Create a DP array where "dp[i]" means: 👉 Can the substring "s[0:i]" be formed using the dictionary? ✔️ Initialize: "dp[0] = True" (empty string is always valid) ✔️ For every index "i", check all "j < i": If "dp[j]" is True AND "s[j:i]" exists in dictionary → mark "dp[i] = True" --- ⚡ Time Complexity: O(n²) ⚡ Space Complexity: O(n) --- 📌 Key Learning: Dynamic Programming helps avoid recomputation by storing results of subproblems. --- 🔥 Consistency is the real game. #DSA #LeetCode #Python #CodingJourney #PlacementPreparation
To view or add a comment, sign in
-
-
I just open-sourced Repo Doctor — a safe-by-default Python CLI + GitHub Action that helps make repositories “open-source ready”. It scans repo hygiene (README, LICENSE, CONTRIBUTING/SECURITY, GitHub Actions CI, .gitignore) and can generate missing essentials. Dry-run first, and it won’t touch your source code. GitHub: https://lnkd.in/eYUd6e2y PyPI: pipx install repo-doctor Feedback and suggestions are very welcome. #OpenSource #GitHub #Python #DevTools #DeveloperExperience
To view or add a comment, sign in
-
-
Day 5 of my 100 Days of Code challenge! 💻🐍 Today I built a Password Generator in Python along with completing the classic FizzBuzz problem. 🔐 Password Generator A program that creates a secure password based on user input. The user chooses how many letters, numbers, and symbols they want, and the program randomly generates and shuffles them to create a strong password. 🔢 FizzBuzz A classic problem where numbers from 1–100 are printed, but multiples of 3 show “fizz”, multiples of 5 show “buzz”, and multiples of both show “fizzbuzz”. Today’s focus was practicing: • Loops (for loops) • The random module • Lists and list manipulation • The modulo operator % • Building and combining logic step by step Learning in public and documenting my journey into software engineering. Check out the projects here: https://lnkd.in/eCYaEybF #100DaysOfCode #Python #SoftwareEngineering #LearningInPublic #CodingJourney
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
-
-
Headline: Day 13/100: The Art of Debugging! Every programmer loves building new things, but today I focused on a much more important skill: Fixing what’s broken. Day 13 was all about the "Code Detective" life—Debugging. What I mastered today: Identifying Bug Patterns: Understanding why a program doesn't do what we expect. The "Print" Strategy: Using print statements to track variable values at every step. Common Pitfalls: Spotting IndexErrors, TypeErrors, and the tricky IndentationErrors. Edge Cases: Thinking about those rare scenarios where the code might fail. Programming isn't just about writing code; it's about problem-solving and persistence. Today’s session made me much more confident in reading and understanding error messages. Check out my growing repository of projects here: https://lnkd.in/gyad3KVM #Python #100DaysOfCode #Debugging #ProblemSolving #SoftwareEngineering #CodeNewbie
To view or add a comment, sign in
-
📣 You can now set a trust status for your upstreams. 💡 This way, once an artifact is identified as internal, it cannot be replaced by an untrusted externally-sourced version. Currently supported for Python, Maven, and NPM. In Early Access for Ultra and Enterprise customers. 👉 Find more details here: https://lnkd.in/eY5TXd3d and in our documentation: https://lnkd.in/ezxaBi6C
To view or add a comment, sign in
-
-
Added SSH support to Pulse Terminal 🖥️ In my last post I shared the cd navigation feature in Pulse, my Python GUI terminal. So let me now share the SSH side of it. - Drag and drop upload: You just grab a file or folder, drop it into the terminal window, and it uploads to whatever remote directory you're currently in. No commands, no paths, just drop it. - Download files and folders: Type 'download filename' and it pulls straight to your Downloads folder. Works for folders too, it recursively grabs everything inside. - Visual connection indicator: The terminal background shifts color the moment you connect to a server. So you always know at a glance whether you're working locally or on a remote machine. Check it out on GitHub: https://lnkd.in/dw6f_g3u #Python #SSH #Terminal #DevTools #PySide6 #Qt #OpenSource
To view or add a comment, sign in
-
I put together a local text-to-speech project using Qwen3-TTS, wrapped in a C# console app and run inside Docker. It takes text from the command line, generates MP3 or WAV files, supports custom output names, and lets you override the voice and speaking style for each run. The repo is set up with the source folder mounted into the container, so code changes are available on the next run without rebuilding the image unless dependencies change. It’s a practical example of combining .NET, Python, Docker, and local AI in a development workflow. Repository: https://lnkd.in/eDuDbjdf #dotnet #csharp #python #docker #ai #tts #machinelearning #opensource
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