🚀 Turning Spaces into URLs — Another Small Win! Today I solved a basic but practical problem on GeeksforGeeks: URLify a string — replacing spaces with "%20". This is actually something used in real-world applications like web development and URL encoding. It made me realize how even simple DSA problems connect to real use cases. I used a clean and efficient approach with Python’s built-in function: 👉 replace() — simple, readable, and powerful. ✅ All test cases passed ✅ Clean one-line solution ✅ Real-world relevance ⏱ Time Complexity: O(n) 💾 Space Complexity: O(n) Sometimes the best solutions are not the most complex ones, but the most elegant ones. Small steps. Daily progress. Strong foundations 💪 How would you solve this — built-in function or manual approach? 🤔 #python #dsa #coding #programming #geeksforgeeks #strings #webdevelopment #developers #learning #100daysofcode
Devanand Rai’s Post
More Relevant Posts
-
A couple of years ago, I wrote that "The Builder pattern is a finite state machine!". A state machine consists of states and transitions between them. As a developer, I want to make illegal states unrepresentable, i.e., users of my API can’t create non-existent transitions. My hypothesis is that only a static typing system allows this at compile-time. Dynamic typing systems rely on runtime validation. In this blog post, I will show that it holds true, with a caveat. If your model has many combinations, you also need generics and other niceties to avoid too much boilerplate code. My exploration will use #Python, #Java, #Kotlin, #Rust, and #Gleam. With that background in mind, let’s move on to the model itself. #builderpattern #finiteStateMachine #illegalState #programming #coding (link in the comments)
To view or add a comment, sign in
-
-
🧠 I built my own programming language — and here it is running on CLI. This is GreyMatter — a custom interpreted language I built from scratch using Python and SLY. What you're seeing in this terminal: → The GreyMatter interpreter starting up (v0.01) → A variable being assigned: a = 50 → An IF/ELSE conditional executing in real time → Output: a is even ✅ The entire interpreter was built by me — from the Lexer and Parser to the AST and Runtime Engine. Why did I build this? Because the best way to understand how Python, JavaScript, or any language works... is to build one yourself. Every keyword you type, every error you get, every output on your screen — there's an entire pipeline behind it. Building GreyMatter made me truly understand that pipeline. 🔗 GitHub: github.com/Abineshabee Drop a 🧠 in the comments if you'd like to see more about how it works! #Python #Programming #OpenSource #BuildInPublic #ComputerScience #InterpreterDesign #GreyMatter #StudentProject #Ben10
To view or add a comment, sign in
-
-
🚀 Day 79 of #100DaysOfCode 💡 LeetCode 338 – Counting Bits Solved today’s problem with a clean and efficient Dynamic Programming + Bit Manipulation approach 💪 🔍 Problem: For a given number "n", return an array where each index "i" contains the number of 1’s in the binary form of "i". ⚡ My Approach: Instead of recalculating bits every time, I reused previous results: 👉 "ans[i] = ans[i >> 1] + (i & 1)" 🧠 Why this works: - "i >> 1" → removes the last bit - "(i & 1)" → checks if last bit is 1 📈 Performance: ✅ Runtime: 3 ms (Beats 95% 🚀) ✅ Memory: 20.14 MB 🔥 Key Learning: Patterns in binary operations can simplify problems drastically. DP + bit tricks = powerful combo ⚡ #Day79 #LeetCode #CodingJourney #Python #DSA #DynamicProgramming #BitManipulation #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 9 of My 30-Day Python Journey Today’s focus was on making functions more flexible and expressive by working with default and keyword arguments. 🔹 What I covered today: • Using default arguments to handle optional inputs • Passing values using keyword arguments for better readability • Understanding positional vs keyword argument behavior • Writing cleaner and more flexible function logic 💡 Key Takeaway: Well-designed functions aren’t just about logic they’re about usability. Default and keyword arguments make code more readable, adaptable, and closer to real-world development practices. 🧪 Practice Focus: Built small utilities like a greeting function with defaults, a calculator with optional inputs, and an order system using keyword-based parameters. 📌 Next Step: Exploring variable-length arguments (*args, **kwargs) to handle dynamic inputs and build more advanced functions. Improving not just how code works but how it’s structured. 💻 #Python #CodingJourney #LearnToCode #Developers #Programming #TechGrowth #100DaysOfCode
To view or add a comment, sign in
-
-
𝐌𝐨𝐬𝐭 𝐩𝐞𝐨𝐩𝐥𝐞 𝐝𝐞𝐟𝐢𝐧𝐞 𝐍𝐮𝐦𝐏𝐲 𝐝𝐚𝐭𝐚 𝐭𝐲𝐩𝐞𝐬 𝐥𝐢𝐤𝐞 𝐭𝐡𝐢𝐬: arr = np.array([1, 2, 3], dtype=np.int8) 𝐁𝐮𝐭 𝐝𝐢𝐝 𝐲𝐨𝐮 𝐤𝐧𝐨𝐰 𝐭𝐡𝐞𝐫𝐞’𝐬 𝐚 𝐬𝐡𝐨𝐫𝐭𝐞𝐫 𝐚𝐧𝐝 𝐜𝐥𝐞𝐚𝐧𝐞𝐫 𝐰𝐚𝐲? 👇 arr = np.array([1, 2, 3, 4, 5, 6], 'i') NumPy provides typecode shortcuts that make your code more concise and readable once you’re familiar with them. In the image attached, I’ve summarized commonly used NumPy datatype shortcuts that can save time and make your code cleaner. 💡 Why this matters: Less verbose code Faster to write Useful in quick scripts and data workflows However, keep in mind: 👉 Using full dtype names (np.int32, np.float64) is often better for readability in larger projects. Balance clarity with efficiency. #Python #NumPy #DataScience #MachineLearning #CodingTips #Programming #Developers
To view or add a comment, sign in
-
-
🔁 Understanding the While Loop in Python The while loop is used when you want to execute a block of code repeatedly as long as a condition is True. It’s especially useful when the number of iterations isn’t fixed. Example: i = 1 while i <= 5: print(i, end=" ") i += 1 Output: 1 2 3 4 5 Key things to remember: • Initialize the variable before the loop • Update the variable inside the loop • Avoid infinite loops by ensuring the condition becomes False Common use cases: ✔ Input validation ✔ Iterating until a condition is met ✔ Counting and accumulation ✔ Menu-driven programs Mastering loops is a small step that builds strong programming logic. #Python #LearningPython #WhileLoop #Coding #Programming #DataAnalytics #PythonBasics
To view or add a comment, sign in
-
🧠 I built my own programming language — GreyMatter! Inspired by Grey Matter from Ben 10 (yes, the alien genius 😄), I created a fully functional interpreted programming language built in Python using SLY. GreyMatter supports: ✅ Variables, loops, and conditionals ✅ User-defined functions with FEEDBACK (return values) ✅ String utilities like WAYBIG() (uppercase) and NANOMECH() (lowercase) ✅ Time utilities via PARADOX.SLEEP() and PARADOX.UNIDATE() ✅ A memory system called BRAINSTORM ✅ Even experimental @WEB_SEARCH and @AI query features! The whole interpreter works through Lexical Analysis → Parsing → AST Generation → Runtime Execution. This project taught me how real-world languages like Python and JavaScript actually work under the hood. If you're a CS student or a curious developer, building your own language is one of the most valuable things you can do. 🔗 GitHub: github.com/Abineshabee #Programming #Python #ComputerScience #OpenSource #LanguageDesign #StudentProject #Interpreter #Ben10 #GreyMatter #BuildInPublic
To view or add a comment, sign in
-
Today, I solved the “Python If-Else” challenge on HackerRank. This problem helped me understand how decision-making works in programming using conditional statements. 📌 What I learned: How to use if, elif, and else statements Writing multiple conditions effectively Understanding decision-making logic in programs This problem may look simple, but it builds a strong foundation for writing complex logic in real-world applications. 🔥 Small steps every day → Big progress in coding! #Python #CodingJourney #HackerRank #100DaysOfCode #Programming #Learning #Developers #Conditionals https://lnkd.in/gNiJcZ3A
To view or add a comment, sign in
-
Most LangChain apps should just be 40 lines of raw API calls. I've refactored three production LangChain projects this year. Every time, ripping out the framework cut latency, halved the debugging time, and made the code readable again. Chains, runnables, callback handlers - layers that exist to manage complexity they created. If your agent fits in one file, you don't need an orchestration framework. You need httpx and a system prompt. Tell me I'm wrong. #langchain #llm #python
To view or add a comment, sign in
-
Small code. Smart validation. 💡 Today I built a simple Python logic to validate phone numbers in different formats — and it reminded me how powerful basics can be. From checking length to handling formats like: ✔️ 03XXXXXXXXX ✔️ 03XX-XXXXXXX ✔️ +92XXXXXXXXXX This small logic represents something bigger: 👉 Clean input validation 👉 Better user experience 👉 Error prevention in real systems As developers, we don’t just write code — We make systems reliable. Every small project like this improves logic, accuracy, and real-world readiness 🚀 If you're learning programming, focus on the basics — That’s where real strength is built. #Python #CodingJourney #LearnToCode #DeveloperLife #ProblemSolving #TechSkills #BuildInPublic
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