🚀 Day 76 — LeetCode Practice 🚀 Today’s problem: Count the Number of Consistent Strings 💡 What I learned today: • Used a boolean array to efficiently track allowed characters • Practiced character indexing (c - 'a') technique • Improved understanding of string traversal using nested loops • Learned how to optimize lookup operations to O(1) 🧠 Key Idea: Store all allowed characters in a boolean array. Then, for each word, check if every character exists in the allowed set. If yes → count it as a consistent string ✅ ⚡ Approach Highlights: • Preprocessing allowed characters • Iterating through each word • Breaking early for invalid characters (optimization) • Counting only valid strings 💻 Language Used: Java Consistency is the key 🔑 — improving step by step every day! #Day76 #LeetCode #Java #CodingJourney #ProblemSolving #100DaysOfCode #Programming #Learning
Counting Consistent Strings with Java
More Relevant Posts
-
🚀 Day 23 of #50DaysOfCode Solved Daily Temperatures (LeetCode 739) 🌡️ Today’s focus was on mastering the Monotonic Stack concept — one of the most powerful patterns in DSA. Learned how to efficiently find the next greater element by storing indices and resolving them smartly instead of brute force. 💡 Key Learnings: • Stack helps reduce time complexity from O(n²) → O(n) • Always think in terms of “pending answers” • Monotonic stacks are 🔥 for interview questions ✅ Status: Accepted ✔️ ⏱️ Optimized approach implemented Every day getting better at problem-solving and consistency 💪 #DSA #LeetCode #Java #CodingJourney #Consistency #100DaysOfCode #Programming
To view or add a comment, sign in
-
-
🚀 Code 6 – #50LeetCodeChallenge 🧩 Problem: Search Insert Position Given a sorted array of distinct integers and a target value, return its index if found. If not, return the position where it should be inserted to maintain sorted order. 💡 Approach: Use Binary Search to efficiently locate the target or its correct insertion position in O(log n) time. 📚 Key Takeaway: Binary search is the go-to technique for problems involving sorted arrays, especially when optimal time complexity is required. #LeetCode #Java #Coding #ProblemSolving #BinarySearch #Arrays #Programming
To view or add a comment, sign in
-
-
🚀 #Day11 of #111DaysOfLearningForChange Continuing my learning consistency challenge with Code for Change. Today, I continued with Object-Oriented Programming (OOP) in Java, focusing on how objects are created and managed. Topics covered: • Encapsulation • Constructors • Types of Constructors: – Parameterized Constructor – Non-Parameterized Constructor – Copy Constructor • Destructors While practicing, I focused on how data can be kept safe inside a class and how objects are created and initialized properly. This session gave me a clearer understanding of how real-world programs are structured using OOP concepts. Consistently learning and improving every day. #CodeForChange #111DaysOfLearningForChange #Day11 #OOP #Consistency #DSAwithJava
To view or add a comment, sign in
-
-
Today I practiced a simple yet important concept of Object-Oriented Programming — Method Overriding. 🔹 Created a parent class (Shape) with a draw() method 🔹 Overrode the same method in child classes Circle and Rectangle 🔹 Demonstrated runtime polymorphism using a parent class reference 💡 This example clearly shows how Java decides which method to call at runtime based on the object type. 📌 Output: Drawing a Circle Drawing a Rectangle ✨ Concepts Covered: ✔ Inheritance ✔ Method Overriding ✔ Runtime Polymorphism #Java #OOP #Programming #Coding #MethodOverriding #Polymorphism #LearningJourney #SoftwareDevelopment #JavaDeveloper
To view or add a comment, sign in
-
-
Day 50 Designing Data-Intensive Applications by Martin Kleppmann Chapter 4 Encoding and Evaluation Thrift and protocol buffer rely on code generation: after a schema is defined, you can generate code that implements this schema in programming language. Useful in statistical typed language such as Java, C#, C++, because it allows efficient in -memory structures to be used for decoded data, and it allows type checking and autocompletion in IDEs when writing programs that access data structures. In dynamically typed programming languages such as JavaScript, Ruby or Python, there is no compile type checker. Avro provides optional code generation for statistically programmed languages. but it can be used just as well without any code generation.
To view or add a comment, sign in
-
-
Today I learned about Runtime Polymorphism in Java. Runtime Polymorphism is achieved using method overriding, where a subclass provides its own implementation of a method defined in the parent class. It helps in achieving dynamic behavior, meaning the method call is resolved at runtime instead of compile time. Example: I created an Animal class with a sound() method, and then different animals override it with their own sound. Dog → Barks Cat → Meows This shows how the same method behaves differently based on the object. #Java #Programming #OOP #Learning #CodingJourney
To view or add a comment, sign in
-
-
Claude Code speaks fluent Python, JavaScript, SQL, and 50 other programming languages. Your dev speaks 2. Maybe 3. Different parts of a software project often need different programming languages. Your website might be built in one language, your database uses another, your automation scripts use a third. Most developers are really strong in a few languages and shakier in others. Claude Code is fluent across all of them, which means your developer can get expert-level help even in the languages they’re less comfortable with. No more “I don’t really know that language” roadblocks. KISS METHOD 💋 💋 Keep it super simple
To view or add a comment, sign in
-
🚀 New YouTube Video Alert! I just uploaded a new video where I practice Java loops by building a Multiplication Table Exercise 🧮 In this tutorial, I explain and demonstrate how to use: 🔹 "for" loop 🔹 "while" loop We go step by step to understand how iteration works in Java and how loops can simplify repetitive tasks. 💡 This exercise is perfect for beginners who want to strengthen their logic and improve their programming skills. 📺 Watch the full video here: [https://lnkd.in/dPqCz2h8] Let’s keep learning and building strong programming fundamentals together 💻🔥 #Java #Programming #Loops #Coding #YouTube #SoftwareDevelopment #LearnToCode
multiplication table in java using for and while loop
https://www.youtube.com/
To view or add a comment, sign in
-
I was tired of having to open my bloated, local IDE to test my code during Codeforces contests, and repetitively typing lines of test cases into STDIN gets really annoying after some time. So, I built an online compiler that speeds up that process and automates the grunt work. It's build on top of a Containerization API that I made myself, and so it's immune to most attacks like fork bombs or disk-fillers, It also makes it easier to visualize the working of that API. The project supports Python, C++, Java and C, the 4 biggest languages on codeforces, feel free to use it on it's deployed URL: https://lnkd.in/g2DB2mPw github repo for the online compiler: https://lnkd.in/g2dkNy3H github repo for the api: https://lnkd.in/g9YPisst
To view or add a comment, sign in
-
-
🚀 Code 3 – #50LeetCodeChallenge Problem: 4Sum Given an array of integers and a target value, find all unique quadruplets that sum up to the target. Each element must be used only once, and the solution set should not contain duplicate combinations. 💡 Approach: Sort the array and use nested loops along with a two-pointer technique to find combinations efficiently. Skip duplicate elements to ensure only unique quadruplets are included. 📚 Key Takeaway: Combining sorting with the two-pointer approach helps reduce complexity and is highly effective for solving multi-sum problems like 4Sum. #LeetCode #Java #Coding #ProblemSolving #Arrays #TwoPointers #Programming
To view or add a comment, sign in
-
Explore related topics
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