Day-91 🔹 *Solved LeetCode Problem: Convert a Number to Hexadecimal!* 🔹 *Problem*: Convert an integer to its hexadecimal representation without using built-in methods. 🔹 *Language*: Java 🔹 *Performance*: + *Runtime*: 0 ms (Beats 100%) + *Memory*: 40.86 MB (Beats 71.40%) 🔹 *Solution*: Utilized bit manipulation to efficiently convert integers to hexadecimal strings. 🔹 #LeetCode #CodingChallenge #Java #Algorithms #ProblemSolving
Solved LeetCode Problem: Convert Integer to Hexadecimal in Java
More Relevant Posts
-
🚀 Day 20 of #100DaysOfLeetCode 💡 Problem: Gray Code Today’s challenge was all about generating the Gray Code sequence, a fascinating binary numbering system where only one bit changes between consecutive numbers. 🧠 Concept: Gray codes are widely used in digital communication and error correction, ensuring minimal transition errors between binary states. 🔍 Key takeaway: Bit manipulation + recursion = elegant solution ✨ 💻 Languages used: Java #LeetCode #100DaysOfCode #ProblemSolving #CodingChallenge #Java #GrayCode #DSA #BitManipulation
To view or add a comment, sign in
-
-
📌 Day 16/100 - Reverse String (LeetCode 344) 🔹 Problem: Reverse a given string in-place — meaning you must modify the original array of characters without using extra space. 🔹 Approach: Used the two-pointer technique — one starting at the beginning and one at the end of the array. Swap characters at both pointers, then move them closer until they meet. Efficient, clean, and runs in linear time without additional memory allocation. 🔹 Key Learnings: In-place algorithms optimize space complexity significantly. The two-pointer pattern is a versatile tool for many array and string problems. Understanding mutable vs immutable structures in Java is crucial for memory efficiency. Sometimes, the simplest logic beats the most complex one. 🧠 “True efficiency lies in simplicity, not complexity.” #100DaysOfCode #LeetCode #Java #ProblemSolving #DSA #CodingJourney #TwoPointers
To view or add a comment, sign in
-
-
🎯 Day 62 of #100DaysOfLeetCode Today I solved the “Merge Two Sorted Lists” problem using Java This problem is a great exercise in understanding how to work with Linked Lists and pointer manipulation. The goal is to merge two sorted linked lists into one sorted list — without using extra space for another list. Key Concepts Practiced: Linked List traversal Dummy node technique Efficient merging using pointers Handling null edge cases Approach Summary: Create a dummy node to simplify edge cases. Use two pointers to traverse both lists. Compare values and link nodes in sorted order. Attach any remaining nodes at the end. #100DaysOfCode #LeetCode #Java #CodingChallenge #DataStructures #LinkedList #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
-
LeetCode Question #199 — Binary Tree Right Side View Thrilled to share another Accepted Solution (100% Runtime 🚀) on LeetCode! This problem focuses on Binary Trees — specifically, how to capture the view of a tree from its right side 🌳➡️. I implemented a Modified Pre-Order Traversal (Root → Right → Left) in Java, ensuring that the first node at each level (from the right) gets recorded. 💡 Key Idea: Use recursion with a level tracker — when the current level equals the list size, it means we’re seeing the rightmost node for the first time. Here’s the performance snapshot: ⚙️ Runtime: 0 ms (Beats 100% of Java submissions) 💾 Memory: 42.4 MB Every problem like this sharpens my understanding of tree traversal patterns and depth-first search optimization. #LeetCode #Java #DataStructures #BinaryTree #ProblemSolving #CodingJourney #DSA #100PercentRuntime
To view or add a comment, sign in
-
-
Day 80 of #100DaysOfCode Solved Frequency Sort in Java 🔠 Approach Today's problem was to sort an array based on the frequency of its numbers. My initial solution was accepted, but it exposed a major efficiency gap! My strategy involved: Sorting the array first. Using nested loops to count the frequency of each number and store it in a HashMap. (Implied) Using the counts to perform the final custom sort. The core issue was the counting method: running a full loop inside another full loop to get the frequency. This quadratic $O(N^2)$ counting completely tanked the performance. ✅ Runtime: 29 ms (Beats 12.02%) ✅ Memory: 45.26 MB (Beats 5.86%) Another great lesson in algorithmic complexity! The difference between $O(N^2)$ and the optimal $O(N \log N)$ for this problem is massive. Time to refactor and implement the fast, single-pass $O(N)$ frequency count using getOrDefault! 💪 #Java #100DaysOfCode #LeetCode #CodingChallenge #Algorithms #Arrays #HashMap #Optimization #ProblemSolving
To view or add a comment, sign in
-
-
Just solved “Search in a Binary Search Tree” in Java with 100% runtime efficiency This problem was a great reminder of how elegant and efficient Binary Search Tree (BST) traversal can be when approached iteratively. 🔍 Key Idea: Start from the root and navigate left or right based on the target value — no recursion, just clean and optimized logic! 💡 Takeaway: Sometimes the simplest, most readable solutions are also the fastest. Writing clean and efficient code is a skill built through consistency and understanding the fundamentals. #Java #LeetCode #DSA #BinarySearchTree #CodingJourney #ProblemSolving #CleanCode
To view or add a comment, sign in
-
-
Day 19 of #100DaysOfLeetCode 💻 Today’s challenge was about finding two unique numbers in an array where every other number appears twice. At first, I tried using an ArrayList — adding numbers if they weren’t present and removing them if they already existed. The logic worked, but I ran into type conversion issues (Object cannot be converted to int). That’s when I learned the importance of using generics in Java (ArrayList<Integer> instead of raw ArrayList). Small syntax details, but they make all the difference! 🔍 Key takeaways: Always specify the data type in collections. Understand how remove() behaves differently for index vs value. Even a brute-force approach can teach valuable debugging lessons. #Day19 #LeetCode #Java #CodingJourney #100DaysOfCode #Debugging #ProblemSolving
To view or add a comment, sign in
-
-
🌳 Day 46 of #LeetCodeJourney Problem: 100. Same Tree ✅ Today’s challenge was about comparing two binary trees — checking if they’re structurally identical and have the same node values. A neat recursive problem that refreshes the basics of tree traversal and recursion! 💡 Key takeaway: If you can break a problem down into smaller identical subproblems — recursion will always have your back. #LeetCode #100DaysOfCode #Java #DSA #BinaryTree #Recursion #CodingJourney
To view or add a comment, sign in
-
-
🎯 LeetCode 394 – Decode String Today I solved a really interesting Stack + String based problem! 💡 Problem Summary: We are given an encoded string containing patterns like 3[a2[c]] where: Numbers represent how many times the substring should repeat. Nested patterns are allowed. The goal is to decode the string correctly. 🧠 Approach: I used two stacks: One to store counts (how many times to repeat) One to store previously formed strings We iterate through the string: Build numbers when digits appear When [ appears, push state to stacks When ] appears, pop and reconstruct substring Else, just append characters normally ⏱️ Time Complexity: O(n) 💾 Space Complexity: O(n) #LeetCode #Java #DSA #Stack #StringManipulation #CodingJourney #LearnEveryday #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