✅ DSA Day 8 / 100 Solved Reverse an Array on HackerRank using Java. Problem: Given an array, return the array in reverse order. Logic : - Use the built-in method Collections.reverse() -This method reverses the elements of the list directly -Then return the reversed list This problem helped me understand how arrays/lists can be manipulated easily using Java utility methods. #DSA #100DaysOfCode #Java #HackerRank #LearningInPublic #BeginnerDSA
Reverse Array in Java using Collections.reverse()
More Relevant Posts
-
Day 41 of #100DaysOfLeetCode 💻✅ Solved #242. Valid Anagram problem in Java. Approach: • Converted both strings to lowercase to ensure case-insensitive comparison • Converted the strings into character arrays • Sorted both arrays using Arrays.sort() • Compared the sorted arrays using Arrays.equals() • If both arrays match, the strings are anagrams Performance: ✓ Runtime: 11 ms (Beats 28.32% submissions) ✓ Memory: 46.83 MB (Beats 8.28% submissions) Key Learning: ✓ Practiced string manipulation and character array handling in Java ✓ Understood how sorting helps in comparing character frequencies ✓ Strengthened problem-solving skills for string-based problems Learning one problem every single day 🚀 #Java #LeetCode #DSA #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 62 of #100DaysOfLeetCode 💻✅ Solved #219. Contains Duplicate II problem in Java. Approach: • Used two nested loops to compare elements within range k • For each element, checked next k elements • If any duplicate is found within distance k, returned true • If no such pair exists, returned false Key Learning: ✓ Practiced checking duplicates within a given range ✓ Strengthened understanding of array traversal with conditions ✓ Learned the importance of optimizing nested loop solutions Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Cracking the Code: How to effectively debug and resolve complex Java Thread Deadlocks One of the most challenging aspects of high-scale systems is managing concurrency. I’ve put together a guide on how to identify, debug, and resolve Java thread deadlocks using thread dumps and automation. https://lnkd.in/gRZYVSzh #Java #Thread #MultiThreading #deadlock #concurrency
To view or add a comment, sign in
-
Day 8 of Java Fundamentals 🚀 Today I started learning the Java Collections Framework, which is widely used in real-world applications. 🔹 List → Ordered, allows duplicates 🔹 Set → No duplicates 🔹 Map → Stores key-value pairs Understanding collections is essential for handling data efficiently in Java applications. Excited to dive deeper into this topic 💻 #Java #LearningInPublic #JavaDeveloper #Collections
To view or add a comment, sign in
-
Many developers ask: Why do Java Collections not support primitive data types? The reason is that Java Collections work with objects, not primitives. To handle primitive values, Java uses Wrapper Classes like Integer, Double, and Character. Example: int → Integer double → Double char → Character This process is called Autoboxing and Unboxing. Understanding such small concepts can make a big difference in mastering Java. 🚀 #CoreJava #JavaTips #Programming #JavaDeveloper
To view or add a comment, sign in
-
🧬 Java Collections – ArrayList Deep Dive Yesterday I explored ArrayList in more detail. ✔️ Looping through elements ✔️ Using methods like remove(), contains(), and size() Understanding these operations helps in managing dynamic data effectively in Java. Also practiced DSA problems like: • Removing even numbers from a list • Finding common elements between two lists Strengthening both collection usage and problem-solving together. 🚀 #Java #Collections #DSA #LearningInPublic #BackendDevelopment #DeveloperJourney
To view or add a comment, sign in
-
Day 4 — Java Stream Practice Today’s focus was on solving a common problem using Java Streams: finding the most frequent element in a collection. Given a list of words, the task was to identify the element that appears the highest number of times. Approach: Grouped elements using Collectors.groupingBy() Counted occurrences with Collectors.counting() Streamed over the map entries Used max() with Map.Entry.comparingByValue() to find the highest frequency Extracted the result using map(Map.Entry::getKey) This exercise reinforced how Streams can simplify data processing by replacing traditional loops with a more declarative approach. Key learning: Breaking down a problem into smaller transformations makes the solution more readable and maintainable. Looking forward to exploring more real-world use cases of Java Streams. #Day4 #Java #JavaStreams #Coding #ProblemSolving #BackendDevelopment #LearnInPublic
To view or add a comment, sign in
-
-
Arrays in java 💫 An array is defined as a homogeneous coollection of information. An array is a linear datastructure,the advantages of using array is, 1.creating an array is simple. 2.storing the data into in array is simple. 3.the retrival of the data from an array is simple. #GRNarendrareddy #Globalquesttechnologies
To view or add a comment, sign in
-
-
🚀 Day 34/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 709. To Lower Case Used ASCII manipulation to convert uppercase letters to lowercase by adding 32, without using built-in functions. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) Strengthening understanding of character encoding and string manipulation basics. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
Day 9 – Java Streams Practice Series Today, I worked on finding the first repeated character in a string using Java Streams. Approach: Converted the string into a stream of characters Used Collectors.groupingBy() with LinkedHashMap to preserve insertion order Counted occurrences of each character Filtered characters with frequency greater than 1 Retrieved the first repeated character using findFirst() Key Learning: Using LinkedHashMap is important because it maintains the order of elements, which helps in identifying the first repeated character correctly. Why this matters: This problem helps strengthen concepts like stream transformations, grouping, counting, and order preservation in collections. Consistent practice is helping me build a deeper understanding of Java Streams and problem-solving. #Java #JavaStreams #CodingPractice #DataStructures #ProblemSolving #BackendDevelopment #100DaysOfCode
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