Day 47 Reverse Words in a String Today’s problem was about reversing words in a string, not characters. => Problem: Given a string, reverse the order of words while keeping each word intact. =>Approach: Split the string into words Reverse the list of words Join them back using spaces code https://lnkd.in/gV-WnTzw #DSA #Python #CodingPractice #100DaysOfCode #ProblemSolving #LeetCode #BackendDeveloper
Reverse String Words in Python
More Relevant Posts
-
I recently worked through a problem from LeetCode. I’d recommend first looking at the problem itself and trying to solve it on your own, and only then comparing it with my solution. Problem: https://lnkd.in/dJ5qxybS My solution: https://lnkd.in/da-dTDKB A good example of how the standard library enables concise and expressive code. #LeetCode #Python #Algorithms #ProblemSolving #SoftwareEngineering #CleanCode
To view or add a comment, sign in
-
-
🚀Discovered why Python lists kill performance (200ms vs 2ms for 1M elements!) while NumPy delivers 100x speedup + 8x less memory. Explained with a chef analogy: cache misses = running to the store, GIL = one chef rule. Read full blog on medium: https://lnkd.in/dWDGWtuw #NumPy #Python #DataScience #Performance #GenAi #DataScience
To view or add a comment, sign in
-
-
Day 28/100 – Time-Based Key-Value Store Worked on designing a key-value store that supports time-based lookups today. The idea was store values along with their timestamps for each key when querying, return the most recent value at or before the given time. Binary search made the lookup efficient once the data was stored in order. Code below #100DaysOfCode #LearningInPublic #LeetCode #Python #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
Day 6 of #50DaysOfTech One question I often see in real projects: Should this be a function or a class? My rule after a few years with Python: If it’s stateless + single responsibility → function If it manages state or behavior over time → class Overusing classes adds unnecessary complexity. Overusing functions can make things unstructured. Balance matters more than patterns. #Python #BackendDevelopment #SoftwareDesign #DeveloperExperience
To view or add a comment, sign in
-
Day 43 – Finding a Substring in a String: Today’s task focused on checking whether a given substring exists within a string using logical conditions instead of complex methods. This exercise reinforced understanding of string comparison, user input handling, and conditional statements, which are essential for basic text search and validation tasks. GitHub Code: https://lnkd.in/gSvGR_NZ #Day43 #100DaysOfCode #Python #StringManipulation #LogicBuilding #ProblemSolving #DailyCoding #Consistency
To view or add a comment, sign in
-
-
Hello Linkedin people 😎 In Python, sometimes we need to change a variable’s type—this is called typecasting. 🔹 Why? To perform calculations To avoid errors 🔹 Example: x = "100" y = int(x) + 50 print(y) # Output: 150 Typecasting helps make our code flexible and error-free! #Python #Typecasting #CodingTips #day4 #qspiders
To view or add a comment, sign in
-
-
💡 A small Python lesson from LeetCode While solving LeetCode #8 (String to Integer – atoi), I wrote two solutions that were both O(n) and logically identical. But one was faster. The reason? Not the algorithm but the way the code was written. Using elif instead of multiple if checks and avoiding extra branching made a noticeable difference. In Python, fewer condition checks = fewer instructions = better runtime. Nice reminder that Big-O isn’t everything, especially in interpreted languages. Learning moments like these are why I enjoy solving problems 😄 #Python #LeetCode #LearningInPublic #SoftwareEngineering #ProblemSolving
To view or add a comment, sign in
-
Learned about the ord() and chr() functions for character–Unicode conversion, the round() function for numerical precision, and proper variable naming conventions. These basics make code more readable and reliable. 🐍💪 #NEXTGENFREEDU🚀 #Python #LearningJourney #ProgrammingBasics #SkillDevelopment
To view or add a comment, sign in
-
Fake Headline Generator 📰 A fun Python project that generates surprisingly realistic news headlines using logic, randomness, and a bit of internet drama 😄 #Python #PythonProjects #FunWithPython #MiniProject #LearningByDoing #ProgrammingLife #DeveloperJourney #CodeWithFun #TechHumor #BuildInPublic
To view or add a comment, sign in
-
A #Python #Pandas rule of thumb: Wherever you can use a column name (string), you can use multiple column names (a list of strings): df.set_index('x') df.set_index(['x', 'y']) df.groupby('last') df.groupby(['last', 'first']) df['x'] df[['x', 'y']] # Notice nested []
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