💻 Day 6 of #30DaysOfCodeChallenge Today’s problem: Reverse a String 🔹 Objective: Take an input string and reverse it. 🔹 Skills practiced: String manipulation, loops, basic algorithm 🔹 Key takeaway: Understanding string traversal and building logic from scratch strengthens your problem-solving skills. Example: Input: "Chetan" → Output: "natehC" ✅ Simple, but reinforces algorithmic thinking and attention to detail. #CodingChallenge #DSA #Java #ProblemSolving #100DaysOfCode
Reverse String Challenge: String Manipulation and Algorithmic Thinking
More Relevant Posts
-
Day: 45/365 📌 LeetCode POTD: Special Binary String Hard Key takeaways/Learnings from this problem: 1. This one teaches that recognizing a balanced structure (like valid parentheses) inside a binary string is the real trick. 2. Big takeaway: recursion + sorting substrings smartly can turn a complex greedy-looking problem into something surprisingly elegant. #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
To view or add a comment, sign in
-
-
While practicing sorting, I noticed something interesting. It’s easy to implement an algorithm. It’s harder to clearly explain its time complexity and behavior in best vs worst cases. Right now, I’m focusing on understanding not just how Bubble Sort works, but why its efficiency changes based on input order. . . . . #DSA #Java #SortingAlgorithms #ProblemSolving #InternshipPreparation
To view or add a comment, sign in
-
🚀 Day 2 of #100DaysOfCode Solved Contains Duplicate on LeetCode ✅ 🧠 Key takeaway: Using a HashSet helps quickly check if any element appears more than once by leveraging constant-time lookups. ⚙️ Approach: 🔹Traverse the array 🔹Add elements to a set 🔹If an element already exists → duplicate found ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) #100DaysOfCode #LeetCode #DSA #Java #HashSet #ProblemSolving #LearningInPublic
To view or add a comment, sign in
-
-
Today’s LeetCode POTD: Key takeaway: leveraging inorder traversal + divide-and-conquer can significantly improve both runtime and memory efficiency when balancing a BST. Small daily improvements compound over time. #LeetCodeDaily #DataStructures #Algorithms #Java #LearningInPublic
To view or add a comment, sign in
-
-
Day 25 – Find Minimum in Rotated Sorted Array Solved this rotated array problem using a modified Binary Search approach in O(log n). Key Learning: By comparing mid with right, I identified which half contains the minimum and reduced the search space efficiently. #DSA #BinarySearch #RotatedArray #Java #InterviewPrep
To view or add a comment, sign in
-
-
Day 13/100 – LeetCode Challenge 🚀 Problem: Binary Search Approach: Maintained left and right pointers Compared middle element with target Reduced the search space by half each step Time Complexity: O(log n) Space Complexity: O(1) Key takeaway: Binary search is the foundation for solving problems with logarithmic efficiency. #LeetCode #100DaysOfCode #DSA #Java #ProblemSolving #InterviewPrep #100DaysOfLeetCode
To view or add a comment, sign in
-
-
𝐖𝐞𝐞𝐤 2 | 𝐃𝐚𝐲 6/7 — 𝐃𝐒𝐀 𝐂𝐡𝐚𝐥𝐥𝐞𝐧𝐠𝐞 Today, I practiced generating 𝐮𝐧𝐢𝐪𝐮𝐞 𝐩𝐞𝐫𝐦𝐮𝐭𝐚𝐭𝐢𝐨𝐧𝐬 𝐨𝐟 𝐚𝐧 𝐚𝐫𝐫𝐚𝐲 containing duplicate elements using Java Backtracking. 𝐊𝐞𝐲 𝐇𝐢𝐠𝐡𝐥𝐢𝐠𝐡𝐭𝐬: • Implemented backtracking with recursion to explore all arrangements • Sorted the array to handle duplicate elements efficiently • Used a boolean tracking array to manage element usage • Applied duplicate-skipping logic to ensure only unique permutations • Strengthened understanding of recursion trees and state tracking This challenge improved my ability to handle duplicate constraints in combinatorial problems, an important concept for technical interviews and real-world algorithm design. #Day6Of7DaysOfCode #DSA #Java #Backtracking #Recursion #ProblemSolving #CodingChallenge #InterviewPrep #Algorithms
To view or add a comment, sign in
-
-
Day 29/100 – LeetCode Challenge 🚀 Problem: Same Tree Approach: Used recursive traversal Compared corresponding nodes of both trees Checked: both nodes null → identical one null → not identical values mismatch → not identical recursively compared left and right subtrees Time Complexity: O(n) Space Complexity: O(h) Key takeaway: Many tree comparison problems reduce to simultaneous traversal of both trees. #LeetCode #100DaysOfCode #DSA #Java #BinaryTree #ProblemSolving
To view or add a comment, sign in
-
-
#Coding4 Q: Check whether a given array is sorted in ascending order. Example: {1, 3, 5, 7, 9} → ✅ Sorted {1, 5, 3, 7} → ❌ Not Sorted I explored 3 different approaches: ✅ 1. Single Pass (Optimal – O(n)) static boolean isSorted(int[] arr) { for(int i = 0; i < arr.length - 1; i++) { if(arr[i] > arr[i + 1]) return false; } return true; } ✅ 2. Using Streams boolean sorted = IntStream.range(0, arr.length - 1).allMatch(i -> arr[i] <= arr[i + 1]); ✅ 3. Compare with Sorted Copy int[] copy = arr.clone(); Arrays.sort(copy); boolean isSorted = Arrays.equals(copy, arr); Key Learnings: Single-pass solution is interview preferred (O(n), O(1)) Streams provide a functional style Sorting approach is simpler but less optimal Practicing fundamentals daily to strengthen problem-solving skills #DSA #Java #Arrays #ProblemSolving #CodingJourney #InterviewPrep #LearningInPublic #LinkedInDSA
To view or add a comment, sign in
-
Day 21 - Binary Search Key Idea: Implemented an iterative binary search to locate the target in a sorted array. Reduced the search interval by half in every iteration to achieve logarithmic runtime. Time Complexity: O(log n) #Day21 #LeetCode #Java #BinarySearch #DSA #Algorithms
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