#Day20 – Rearranging Arrays Using Two Pointer 😲 -#Programming ⚠️ Today’s programming session focused on array rearrangement problems and improving problem-solving logic using pointers. ✔ Learned how to rearrange array elements without creating a new array ✔ Used the two-pointer approach (i and j) to optimize space complexity ✔ Practiced keeping the original order of elements while rearranging ✔ Understood how to separate special values (like -1 or 0) from other elements ✔ Learned how array objects are passed by reference in Java, so modifications reflect in the original array Example problem solved: Rearrange an array so that all -1 values appear on one side and positive numbers on the other side while maintaining order. TAP Academy Harshit T Somanna M G #Java #Arrays #ProblemSolving #DSA #ProgrammingJourney #Consistency
Rearrange Arrays with Two Pointer Technique in Java
More Relevant Posts
-
We have executed below areas in Ruby Programming Language, Ruby-Blocks - Completed (4 testcases) Modules&Mixins- Completed (3 testcases) Strings- Completed (2 testcases) Arrays- Completed (6 testcases) Hashes-Completed (3 testcases) Date&Time-Completed (6 testcases) Ranges-Completed (4 testcases) Total - 28testcases Attached screenshot can be referred for Successful outcome. #rubyasprogram #rubyprogramming #testexecution
To view or add a comment, sign in
-
-
#Day26 – String Programming (Cont.) -#Programming⚠️ Today’s session was all about understanding how to actually think while solving string problems, not just writing code. I worked on breaking a string into individual characters and applying logic step by step. Learned how to count vowels properly, including handling uppercase and lowercase cases which initially caused errors. Also understood why some simple-looking approaches fail, especially when we ignore different types of characters like numbers and special symbols. One important concept was identifying character types using ranges, which helped in separating alphabets, numeric values, and special characters correctly. TAP Academy Harshit T Somanna M G #Java #Strings #ProblemSolving #CodingJourney #Consistency
To view or add a comment, sign in
-
Learn Programming with Arrays, Lists, Sets and Maps with Practical Examples Session 1: Concept of Arrays in Java | Programming with Arrays, Lists, Sets and Maps Series Learn It Easy: https://lnkd.in/gad2uaM3 #arrays #programming #automationtesting #sets #maps #lists #java #learntocode #seleniumwebdriver #dezlearn #dezinnia #happylearning
Session 1: Concept of Arrays in Java | Programming with Arrays, Lists, Sets and Maps Series
https://www.youtube.com/
To view or add a comment, sign in
-
day 6 DSA problems and solutions link :- https://lnkd.in/gt8GeiUw topics:- Valid anagram and remove duplicates from sorted array #dsa #problems #thinking #logic #solutions #java #programming
To view or add a comment, sign in
-
Day 25 of Programming Today, I focused on solving problems related to index finding and subsequences — two important concepts that sharpen problem-solving and string manipulation skills. 💡 What I learned: How to find the index of a specific character (k) in a string Understanding first occurrence vs last occurrence Exploring subsequences and how they differ from substrings Generating all possible subsequences using recursion ✨ Key Concepts: Indexing helps in efficient searching within strings A subsequence maintains order but doesn’t require continuity Recursive thinking makes complex problems easier to break down 🧠 Problems I solved: Find the first and last index of a character in a string Count how many times a character appears Check if one string is a subsequence of another Generate all subsequences of a given string Find the longest subsequence under given conditions #Programming #CodingJourney #ProblemSolving #Java #Learning
To view or add a comment, sign in
-
-
PROBLEM #10 ⚡ , MOVE ZEROES, in #leetcode by using two pointer method. swapping the non zeroes to the left and the zeroes to the right. time complexity - o(n); #problemsolving #dsa #arrays #geeksforgeeks #java #programming #computerscience #developer #datastructuresandalgorithms
To view or add a comment, sign in
-
-
-----Continuing my DSA journey---- * Problem: Restore The Array (1416) * Approach: -I solved this using Dynamic Programming. -I used a DP array where dp[i] represents the number of ways to form valid arrays starting from index i. For each position: • I built numbers digit by digit • Checked if the number is within the limit k • Added valid possibilities using previously computed results * Key Insight: The tricky part was handling large numbers and avoiding leading zeros. Breaking early when the number exceeds k helps optimize the solution. * What I Learned: This problem improved my understanding of DP on strings. #LeetCode #DSA #Java #DynamicProgramming #Strings #ProblemSolving
To view or add a comment, sign in
-
-
Day 20 of Programming – Rearranging Programs Today I practiced array rearrangement problems, which are very useful for improving logic building and problem-solving skills. Rearranging elements in an array helps in understanding index manipulation, swapping techniques, and efficient iteration. 🔹 What I learned today: ✅ Rearranging elements based on conditions ✅ Using loops and swapping techniques ✅ Improving array manipulation skills ✅ Writing optimized solutions 🔹 Practice Problems I Worked On: • Rearrange array in ascending and descending order • Rearrange array so positive and negative numbers alternate • Move all zeros to the end of the array • Rearrange elements so that even numbers come before odd numbers • Reverse an array using swapping technique #Programming #Java #Arrays #ProblemSolving #CodingJourney #Developer #LearningToCode
To view or add a comment, sign in
-
-
Day 13 of #LeetCode75 Complete! 75 Days of Coding Topic: Sliding Window Problem: Maximum Average Subarray I Today, I attempted the Maximum Average Subarray I problem on LeetCode using the Java programming language. The problem required me to find the maximum average value among all possible contiguous subarrays of size 𝑘. 🔍 Approach: I did not use the sliding window technique to find the solution to the problem. Instead, I implemented the optimized solution using the prefix sum technique: I created the prefix sum array to store the cumulative sum. I computed the sum of the subarray using the formula: prefix[i] - prefix[i - 𝑘] and divided the maximum sum by 𝑘. 📚 What I learned: I learned how to use the prefix sum array to store the cumulative sum. I learned how to avoid redundant calculations. I learned the different techniques that could be implemented to solve the sliding window problems. 📌 Key Insight: The prefix sum array is helpful in avoiding redundant calculations. #LeetCode75 #LeetCode #Java #DS #SlidingWindow #ProblemSolving
To view or add a comment, sign in
-
-
The Perl qw() operator is a useful feature for transforming strings into arrays, enhancing code readability and efficiency. This article explores its syntax, functionality, and real-world examples for better data handling in scripts. 🔗 Read more: https://lnkd.in/dM4NNdM3 #Perl #SoftwareDevelopment #Programming #CodingBestPractices #Developers #TechLearning
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