🚀 Day 89 of #100DaysOfCode | LeetCode Daily Solved LeetCode Problem #190 – Reverse Bits 🔄💻✅ A classic bit-manipulation problem that really sharpens understanding of how numbers are represented at the binary level. Clean logic, constant time, and pure fundamentals. Key Takeaways: -> Working with bitwise operators (&, <<, >>>) -> Reversing bits by extracting LSB and placing it at the correct position -> Understanding 32-bit integer representation -> Efficient O(1) solution with no extra space Language: Java -> Runtime: 1 ms (Beats 60.34%) -> Memory: 42.61 MB Mastering the basics makes advanced problems feel lighter. Still showing up. Still learning. 🔥💻 #LeetCode #Java #BitManipulation #ReverseBits #ProblemSolving #100DaysOfCode
LeetCode 190: Reverse Bits in Java
More Relevant Posts
-
🚀 Day 5 – LeetCode Practice Today, I solved the Reverse Nodes in k-Group problem on LeetCode: 🎯 Difficulty: Hard 💻 Language Used: Java 💡 Approach: • Given a linked list and an integer k, the task was to reverse every group of k nodes. • I used pointer manipulation and a dummy node to handle group reversals cleanly. • Moved through the list in blocks of k, reversing each sub-group by re-wiring next pointers. • Ensured that if the final group had fewer than k nodes, it was kept as-is. • This approach ensured in-place reversal without extra space. ⏱ Complexity: • Time Complexity: O(n) • Space Complexity: O(1) 📚 Key Takeaway: This problem deepened my understanding of in-place linked list manipulation, group operations, and edge-case handling when list length isn’t a multiple of k. Solving pattern-rich, hard problems like this consistently improves my algorithmic thinking and implementation precision. 💪 #LeetCode #Java #DSA #LinkedList #ProblemSolving #Algorithms #CodingPractice #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 6 – LeetCode Practice Today, I solved the Divide Two Integers problem on LeetCode: 🎯 Difficulty: Medium 💻 Language Used: Java 💡 Approach: • Given two integers dividend and divisor, the task was to divide them without using multiplication, division, or modulus operators. • I handled edge cases like overflow and negative values first. • Converted values to long to avoid overflow while calculating. • Used bit manipulation (left shifts) to subtract multiples of divisor efficiently, mimicking division logic. • Adjusted sign of the result based on original signs. ⏱ Complexity: • Time Complexity: O(log n) (where n = absolute dividend) • Space Complexity: O(1) 📚 Key Takeaway: This problem strengthened my understanding of bit manipulation, efficient arithmetic without built-in operators, and careful edge case handling for overflow and sign corrections. Consistent problem-solving practice continues to enhance my logic, efficiency, and confidence in algorithmic challenges. 💪 #LeetCode #Java #DSA #BitManipulation #ProblemSolving #Algorithms #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 90 of #100DaysOfCode | LeetCode Daily Solved LeetCode Problem #401 – Binary Watch ⌚💻✅ A fun problem that blends bit manipulation with simple iteration. The idea is to count set bits for hours and minutes and generate all valid time combinations. Key Takeaways: -> Smart use of Integer.bitCount() for counting LEDs -> Separating hours (0–11) and minutes (0–59) cleanly -> Formatting time output correctly (leading zeros matter!) -> Brute force done right with clear constraints Language: Java -> Runtime: 3 ms (Beats 91.19%) -> Memory: 43.45 MB (Beats 94.31%) Consistency builds confidence. 90 days in — still pushing forward. 🔥💻 #LeetCode #Java #BitManipulation #BinaryWatch #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
Day 47 - LeetCode Journey Solved LeetCode 520: Detect Capital in Java ✅ A simple yet interesting string problem that checks whether capital letters in a word are used correctly. Valid cases: • All letters are uppercase → "USA" • All letters are lowercase → "leetcode" • Only first letter is uppercase → "Google" Approach was straightforward: Count uppercase letters and validate based on the three conditions. Clean logic makes this problem easy and readable. Key takeaways: • Strong understanding of string traversal • Using built-in functions like Character.isUpperCase() • Writing clear conditional logic • Handling edge cases properly ✅ All test cases passed ✅ Clean and efficient solution Small problems like this strengthen fundamentals, and strong fundamentals are the backbone of DSA 🚀 #LeetCode #DSA #Java #Strings #ProblemSolving #CodingJourney #Programming #InterviewPrep #Consistency
To view or add a comment, sign in
-
-
🚀 Day 94 of #100DaysOfCode Solved LeetCode #762 – Prime Number of Set Bits in Binary Representation ✅ A neat problem combining bit manipulation with a simple prime check. Key Takeaways: -> Using Integer.bitCount() for efficient set-bit counting -> Applying basic prime validation on computed bits -> Clean iteration over a given range Simple logic, but great for reinforcing bitwise fundamentals Language: Java -> Runtime: 4 ms (Beats 87.21%) ⚡ -> Memory: 42.28 MB Consistency is stacking up day by day. On to the next one. 💻🔥 #LeetCode #Java #BitManipulation #PrimeNumbers #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
#Day28 of #365DaysOfCode Today’s LeetCode practice: 🔹 Word Search (LeetCode 79) Solved a backtracking problem where I had to check whether a given word exists in a 2D board by moving horizontally or vertically through adjacent cells. 💡 Key Insight: Start exploring from every cell. If the character matches the current letter of the word, move in all 4 possible directions. Mark the cell as visited and revert the change if the path doesn’t lead to a solution. On to Day 29 🔥 #LeetCode #Java #DSA #ProblemSolving #CodingJourney #Backtracking #Recursion
To view or add a comment, sign in
-
-
Day 17 – Daily DSA Practice Solved LeetCode 401: Binary Watch today. A simple yet insightful problem focused on bit manipulation and careful formatting. Iterated through all valid hour and minute combinations, used Integer.bitCount() to filter cases, and ensured correct time representation. A good reminder that when constraints are small, a clean brute-force approach is often the most practical solution. #LeetCode #DSA #Java #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 33 — LeetCode Practice 🚀 Today’s focus was on improving string manipulation and logical thinking with an interesting problem. ✅ Problem solved today: 🔹 Second Largest Digit in a String 💡 Key learnings from today: • Practiced traversing an alphanumeric string efficiently • Learned how to extract and work only with numerical digits • Strengthened understanding of tracking largest and second largest values • Improved handling of edge cases like duplicate digits • Focused on optimizing the solution to achieve O(n) time complexity Even though the logic was simple, the problem emphasized the importance of careful iteration and condition handling. Small optimizations can make solutions more efficient and clean. Clear logic. Efficient traversal. O(n) time complexity. Small consistent steps are building stronger problem-solving skills every single day 💪 On to Day 34 🚀 #Day33 #DSA #LeetCode #ProblemSolving #Java #CodingJourney #Consistency #FutureEngineer
To view or add a comment, sign in
-
-
🚀 DSA Consistency — Day 10 Continuing my consistency journey, today I solved the LeetCode problem “Sort Integers by The Number of 1 Bits.” 🔎 Key learning from today: The problem focused on sorting elements based on a custom criteria — primarily the count of set bits in each number, and secondarily their numeric value. I approached this by grouping numbers according to their set bit count using ordered data structures and then sorting within each group. 💡 This problem reinforced: ✅ Bit manipulation fundamentals ✅ Custom sorting logic ✅ Effective use of Java Collections (TreeMap + ArrayList) ✅ Translating problem constraints into clean implementation Maintaining daily problem-solving discipline is helping me sharpen both my problem-solving mindset and implementation clarity. 📌 You can check out my solution here: https://lnkd.in/d-ESnvjq #DSA #LeetCode #Consistency #ProblemSolving #Java #BitManipulation #CodingJourney
To view or add a comment, sign in
-
-
Day 30 | LeetCode Daily Solved LeetCode Problem #190 – Reverse Bits Concept: • Bit manipulation • Bitwise operators and shifting Key Learnings: • Bit operations allow efficient manipulation at the binary level • Shifting and masking are powerful tools for low-level operations 30 days of consistent problem solving completed. This journey reinforced an important lesson: consistency beats intensity. Looking forward to continuing this learning streak. Submission link: https://lnkd.in/gBW-puEA #LeetCode #DSA #BitManipulation #Java #ProblemSolving
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
Superb approach Vivek Jetani keep going🙊❣️