🚀 Excited to share that I explored some essential Java String Methods under the guidance of G.R Narendra Reddy sir. This session was focused on understanding built-in string functions and their real-time usage. It helped me strengthen my knowledge of string handling and writing efficient code. 🔹 Key Implementations Covered: ✔️ equals() – Comparing content of two strings ✔️ equalsIgnoreCase() – Comparing strings ignoring case sensitivity ✔️ compareToIgnoreCase() – Lexicographical comparison without case sensitivity ✔️ concat() – Joining two strings ✔️ indexOf() – Finding position of characters/substrings ✔️ isBlank() – Checking if string is empty or contains only spaces ✔️ isEmpty() – Checking if string is empty ✔️ length() – Finding length of string ✔️ replace() – Replacing characters or substrings ✨ What I Practiced: ✔️ Using built-in string methods effectively ✔️ Writing clean and optimized Java programs ✔️ Improving logic with real-time examples 💡 Key Learnings: ✔️ Strong understanding of string methods ✔️ Efficient string comparison techniques ✔️ Code readability and performance improvement 🎯 Why It Matters: String methods are widely used in real-world applications like validation, searching, and data processing. 🌱 Consistency in practice turns skills into expertise! G.R NARENDRA REDDY Sir Global Quest Technologies #Java #Programming #Coding #StringMethods #JavaDeveloper #LearningJourney #ProblemSolving #TechSkills #StudentDeveloper
More Relevant Posts
-
💡 Understanding the var Keyword in Java While learning modern Java, I came across the var keyword — a small feature that makes code cleaner, but only when used correctly. Here’s how I understand it 👇 In Java, when we declare a variable using var, the compiler automatically determines its data type based on the value assigned. For example: java var name = "Akash"; Here, Java infers that name is of type String. ⚠️ One important clarification: It’s not the JVM at runtime — type inference happens at compile time, so Java remains strongly typed. ### 📌 Key Rules of var ✔️ Must be initialized at the time of declaration java var a = "Akash"; // ✅ Valid var b; // ❌ Invalid ✔️ Can only be used inside methods (local variables) ❌ Not allowed for: * Instance variables * Static variables * Method parameters * Return types ### 🧠 Why use var? It helps reduce boilerplate and makes code cleaner, especially when the type is obvious: java var list = new ArrayList<String>(); ### 🚫 When NOT to use it Avoid `var` when it reduces readability: java var result = getData(); // ❌ unclear type ✨ My takeaway: `var` doesn’t make Java dynamic — it simply makes code more concise while keeping type safety intact. I’m currently exploring Java fundamentals and system design alongside frontend development. Would love to hear how you use var in your projects 👇 Syed Zabi Ulla PW Institute of Innovation #Java #Programming #LearningInPublic #100DaysOfCode #Developers #CodingJourney
To view or add a comment, sign in
-
-
🚀 DSA Journey — LeetCode Practice 📌 Problem: Same Tree 💻 Language: Java 🔹 Approach: To solve this problem, I used Recursion to compare both binary trees node by node. • If both nodes are null → return true • If one node is null and the other is not → return false • If node values are different → return false • Recursively compare left subtrees • Recursively compare right subtrees • If both left and right comparisons return true → both trees are identical This approach works because each subtree is itself a smaller version of the same problem, making recursion a natural fit. ⏱ Time Complexity: O(n) 🧩 Space Complexity: O(h) (where h = height of tree, worst case O(n)) 📖 Key Learning: This problem strengthened my understanding of tree traversal, recursion, and base case handling. It also reinforced how breaking a problem into smaller subproblems makes tree problems much easier to solve 💡 #DSA #Java #LeetCode #ProblemSolving #CodingJourney #LearningInPublic #BinaryTree #Recursion
To view or add a comment, sign in
-
-
🚀 DSA Journey — LeetCode Practice 📌 Problem: Binary Tree Inorder Traversal (LeetCode 94) 💻 Language: Java 🔹 Approach: To solve this problem, I used Depth-First Search (DFS) with Recursion to perform inorder traversal of the binary tree. • Recursively traverse the left subtree • Visit the root node and store its value • Recursively traverse the right subtree • Follow Inorder pattern: Left → Root → Right This approach works efficiently because recursion naturally follows the inorder traversal structure. ⏱ Time Complexity: O(n) 🧩 Space Complexity: O(n) (including recursion stack) 📖 Key Learning: This problem strengthened my understanding of DFS, recursion, and tree traversal patterns. It also reinforced the inorder pattern (Left → Root → Right), which is a fundamental concept used in many tree-based problems 💡 #DSA #Java #LeetCode #ProblemSolving #CodingJourney #LearningInPublic #BinaryTree #DFS #Recursion #TreeTraversal
To view or add a comment, sign in
-
-
🚀 DSA Journey — LeetCode Practice 📌 Problem: Binary Tree Postorder Traversal (LeetCode 145) 💻 Language: Java 🔹 Approach: To solve this problem, I used Depth-First Search (DFS) with Recursion to perform postorder traversal of the binary tree. • Recursively traverse the left subtree • Recursively traverse the right subtree • Visit the root node and store its value • Follow Postorder pattern: Left → Right → Root This approach works efficiently because recursion naturally follows the postorder traversal structure. ⏱ Time Complexity: O(n) 🧩 Space Complexity: O(n) (including recursion stack) 📖 Key Learning: This problem strengthened my understanding of DFS, recursion, and tree traversal patterns. It also reinforced the postorder pattern (Left → Right → Root), which is a fundamental concept used in many tree-based problems 💡 #DSA #Java #LeetCode #ProblemSolving #CodingJourney #LearningInPublic #BinaryTree #DFS #Recursion #TreeTraversal
To view or add a comment, sign in
-
-
🚀 DSA Journey — LeetCode Practice 📌 Problem: Binary Tree Preorder Traversal (LeetCode 144) 💻 Language: Java 🔹 Approach: To solve this problem, I used Depth-First Search (DFS) with Recursion to perform preorder traversal of the binary tree. • Visit the root node first • Store the root value in the result list • Recursively traverse the left subtree • Recursively traverse the right subtree • Follow Preorder pattern: Root → Left → Right This approach works efficiently because recursion naturally follows the preorder traversal structure. ⏱ Time Complexity: O(n) 🧩 Space Complexity: O(n) (including recursion stack) 📖 Key Learning: This problem strengthened my understanding of DFS, recursion, and tree traversal patterns. It also reinforced the preorder pattern (Root → Left → Right), which is a fundamental concept used in many tree-based problems 💡 #DSA #Java #LeetCode #ProblemSolving #CodingJourney #LearningInPublic #BinaryTree #DFS #Recursion #TreeTraversal
To view or add a comment, sign in
-
-
Day 3 of Java with DSA Journey 🚀 📌 Topic: Guess Number Higher or Lower (LeetCode 374) 💬 Quote: "Efficiency is not about doing more; it's about eliminating what doesn't matter." ✨ What I Learned: 🔹 Binary Search Beyond Arrays: Binary Search isn’t limited to arrays — it works perfectly on a number range like [1...n]. 🔹 Working with APIs: Learned how to adapt logic based on API responses: -1 → Guess is too high 1 → Guess is too low 0 → Correct answer 🔹 Power of Efficiency: Even for a huge range (up to 2³¹ - 1), Binary Search finds the answer in ~31 steps 🤯 Compared to Linear Search → practically impossible! 🔹 Complexity: ⏱ Time: O(log n) 📦 Space: O(1) 🧠 Problem Solved: ✔️ Guess Number Higher or Lower 💡 Key Insight: This problem highlights the “Narrowing the Search Space” concept. Each step eliminates half the possibilities — that’s the magic of logarithmic algorithms ⚡ ⚡ Interview Insight (3-Way Decision Logic): Unlike boundary problems, here we deal with three outcomes: 1️⃣ 0 → Found the number (return immediately) 2️⃣ -1 → Move right = mid - 1 3️⃣ 1 → Move left = mid + 1 👉 Use while (left <= right) since the target is guaranteed to exist. 🔑 Takeaway: Consistency beats intensity. Showing up daily is what builds mastery. #DSA #LeetCode #Java #CodingJourney #BinarySearch #ProblemSolving #100DaysOfCode #JavaDeveloper #Algorithms
To view or add a comment, sign in
-
-
🚀 Day 54 – Mastering TreeSet in Java Today I explored one of the most powerful classes in the Java Collection Framework — TreeSet. 🔍 Key Learnings: ✅ Stores unique elements (no duplicates) ✅ Maintains automatic sorting (ascending order) ✅ Uses Binary Search Tree (BST) internally ✅ Sorting is achieved using Inorder Traversal (LVR) ✅ Does not allow null values ✅ Does not support heterogeneous data (requires comparison) 📌 Important Concepts: Left < Root < Right (BST logic) No indexing → cannot use traditional for loop Access using Iterator / For-Each Supports both ascending & descending traversal 🛠️ Methods I Practiced: first() & last() headSet(), tailSet(), subSet() ceiling(), floor(), higher(), lower() pollFirst(), pollLast() 💡 Real-world Use Case: Useful for building features like leaderboards, ranking systems, and sorted data processing. 📈 Understanding how TreeSet works internally (BST + traversal) really helped me connect Data Structures with Java Collections. #Java #CollectionsFramework #TreeSet #DataStructures #LearningJourney #100DaysOfCode #JavaDeveloper
To view or add a comment, sign in
-
-
Leetcode Practice - 15. 3Sum The problem is solved using JAVA. Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. Example 1: Input: nums = [-1,0,1,2,-1,-4] Output: [[-1,-1,2],[-1,0,1]] Explanation: nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0. nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0. nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0. The distinct triplets are [-1,0,1] and [-1,-1,2]. Notice that the order of the output and the order of the triplets does not matter. Example 2: Input: nums = [0,1,1] Output: [] Explanation: The only possible triplet does not sum up to 0. Example 3: Input: nums = [0,0,0] Output: [[0,0,0]] Explanation: The only possible triplet sums up to 0. Constraints: 3 <= nums.length <= 3000 -105 <= nums[i] <= 105 #LeetCode #Java #CodingPractice #ProblemSolving #DSA #Array #DeveloperJourney #TechLearning
To view or add a comment, sign in
-
-
🧱 SOLID Principles in Java – Write Code That Doesn't Come Back to Haunt You You know that feeling when touching one feature breaks three unrelated things? That's what life looks like without SOLID principles. I just published a deep-dive post covering all five principles with real Java examples: ✅ Single Responsibility – One class, one job. Stop your Invoice class from moonlighting as a printer AND a database. ✅ Open/Closed – Extend behavior without cracking open existing code. No more endless if-else chains. ✅ Liskov Substitution – Your Penguin shouldn't throw UnsupportedOperationException when asked to fly. ✅ Interface Segregation – Stop forcing Robots to implement an eat() method. ✅ Dependency Inversion – Depend on abstractions, not implementations. Your service shouldn't care if it's MySQL or PostgreSQL. 🔗 Read the full post: https://lnkd.in/gfA5g8VG #Java #SOLID #CleanCode #SoftwareEngineering #OOP #DesignPrinciples #BackendDevelopment #SpringBoot #Programming #TechBlog #100DaysOfCode
To view or add a comment, sign in
-
🚀 DAY 98/150 — TOP K FREQUENT ELEMENTS! 🔥📊 Day 98 of my 150 Days DSA Challenge in Java and today I solved a very popular interview problem that combines HashMap + Heap (Priority Queue) 💻🧠 📌 Problem Solved: Top K Frequent Elements 📌 LeetCode: #347 📌 Difficulty: Medium 🔹 Problem Insight The task is to return the k most frequent elements in an array. 👉 Instead of sorting the entire array, we need an efficient way to track frequencies and extract top elements. 🔹 Approach Used I used HashMap + Min Heap: • First, count frequency of each element using a HashMap • Then, maintain a Min Heap of size k based on frequency • If heap size exceeds k → remove the least frequent element ✔️ Finally, heap contains the k most frequent elements ⏱ Complexity Time Complexity: O(n log k) Space Complexity: O(n) 🧠 What I Learned • Frequency-based problems often use HashMap • Heap helps optimize Top K problems efficiently • Avoid full sorting when only top elements are required 💡 Key Takeaway This problem taught me: How to combine counting + priority queue How to optimize from O(n log n) → O(n log k) Importance of choosing the right data structure 🌱 Learning Insight Now I can clearly recognize: 👉 Top K Pattern → Use Heap 👉 Frequency Problem → Use HashMap ✅ Day 98 completed 🚀 52 days to go 🔗 Java Solution on GitHub: 👉 https://lnkd.in/gtDixfZY 💡 Don’t sort everything — just focus on what matters. #DSAChallenge #Java #LeetCode #Heap #HashMap #TopK #PriorityQueue #150DaysOfCode #ProblemSolving #CodingJourney #InterviewPrep #LearningInPublic
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