⚡ Day 85 of #100DaysOfDSA – Reverse Bits 💡 📌 Problem. no 190: Given a 32-bit unsigned integer, reverse its bits and return the result. Solved using bit manipulation by shifting and combining bits efficiently through iterative processing. ⚡ Runtime: 15 ms – Beats 74.65% of submissions 💾 Memory: 12.49 MB – Beats 49.36% of solutions 💻 Language Used: Python ✅ Status: Accepted – All 600 test cases passed successfully! This problem strengthened my understanding of low-level bit operations, binary manipulation, and efficient use of shifting operators. It’s a great reminder that small operations can have big effects on data representation. 🔑 Key Learnings: ✔️ Learned how to manipulate bits effectively using bitwise operators ✔️ Understood the significance of shifting and masking in binary form ✔️ Improved my grasp of algorithmic efficiency at the bit level 🎯 Day 85 — A smart bitwise challenge that sharpened my binary logic and precision-based problem-solving! ⚙️💻🔥 #100DaysOfCode #100DaysOfDSA #LeetCode #PythonProgramming #DataStructures #AlgorithmPractice #CodeNewbie #DailyCoding #ProblemSolving #TechJourney #WomenWhoCode #CodeLife #CodingChallenge #DSAChallenge #DeveloperLife #PythonDeveloper #LearnToCode #CodingCommunity #CodeEveryday #SoftwareEngineering #KathirCollegeOfEngineering #KathirCollege #BTechLife #AIDS #FutureEngineer #CodingMotivation #ProgrammingSkills
Reversing 32-bit integer bits in Python with DSA
More Relevant Posts
-
⚡ Day 83 of #100DaysOfDSA – Majority Element 💡 📌 Problem. no 169: Given an array nums, find the element that appears more than ⌊n / 2⌋ times. Implemented an efficient hash map-based counting approach to track element frequency and determine the majority element quickly. ⚡ Runtime: 13 ms – Beats 37.81% of submissions 💾 Memory: 13.60 MB – Beats 64.79% of solutions 💻 Language Used: Python ✅ Status: Accepted – All 53 test cases passed successfully! This challenge helped me better understand frequency counting, dictionary operations, and threshold-based decision making. It’s a great problem for mastering counting logic and handling arrays efficiently. 🔑 Key Learnings: ✔️ Strengthened my understanding of hash maps and element frequency counting ✔️ Learned how to use early termination for optimization ✔️ Improved confidence in solving majority and occurrence-based problems 🎯 Day 83 — A solid step forward in mastering counting logic and data structure efficiency! 🚀🔥 #100DaysOfCode #100DaysOfDSA #LeetCode #PythonProgramming #DataStructures #AlgorithmPractice #CodeNewbie #DailyCoding #ProblemSolving #TechJourney #WomenWhoCode #CodeLife #CodingChallenge #DSAChallenge #DeveloperLife #PythonDeveloper #LearnToCode #CodingCommunity #CodeEveryday #SoftwareEngineering #KathirCollegeOfEngineering #KathirCollege #BTechLife #AIDS #FutureEngineer #CodingMotivation #ProgrammingSkills
To view or add a comment, sign in
-
-
📌 Problem. no 179: Given a list of non-negative integers, arrange them such that they form the largest possible number. Solved using a custom comparator to sort numbers based on concatenation order and achieve the optimal result. ⚡ Runtime: 3 ms – Beats 78.56% of submissions 💾 Memory: 12.69 MB – Beats 24.66% of solutions 💻 Language Used: Python ✅ Status: Accepted – All 235 test cases passed successfully! This problem enhanced my understanding of string-based comparison, custom sorting, and optimization through logic-based ordering. It’s an elegant challenge that blends sorting and string manipulation seamlessly. 🔑 Key Learnings: ✔️ Learned how to design and implement custom comparators ✔️ Understood how concatenation order affects numeric outcomes ✔️ Strengthened my grasp on sorting logic and greedy approaches 🎯 Day 84 — A creative challenge that refined my problem-solving through custom sorting and logical structuring! 🚀🔥 #100DaysOfCode #100DaysOfDSA #LeetCode #PythonProgramming #DataStructures #AlgorithmPractice #CodeNewbie #DailyCoding #ProblemSolving #TechJourney #WomenWhoCode #CodeLife #CodingChallenge #DSAChallenge #DeveloperLife #PythonDeveloper #LearnToCode #CodingCommunity #CodeEveryday #SoftwareEngineering #KathirCollegeOfEngineering #KathirCollege #BTechLife #AIDS #FutureEngineer #CodingMotivation #ProgrammingSkills
To view or add a comment, sign in
-
-
🚀 DSA Progress – Day 96 ✅ Problem #1404: Number of Steps to Reduce a Number in Binary Representation to One 🧠 Difficulty: Medium | Topics: String, Bit Manipulation, Simulation 🔍 Approach: Implemented a bitwise simulation approach to reduce a binary string to "1" without converting it to an integer. Step 1 (Right-to-Left Traversal): Start from the least significant bit (rightmost) and move leftwards until the most significant bit. Step 2 (Check Bit + Carry): At each step, evaluate (bit + carry) — If the result is odd (1) → perform two operations: add 1 (causing carry) and divide by 2. If the result is even (0) → perform one operation: divide by 2. Step 3 (Carry Handling): Maintain a carry variable to track the overflow when a +1 operation is applied. After the loop, if a carry still exists, add it to the total count. This method effectively simulates binary addition and division using string traversal, avoiding large integer conversions. 🕒 Time Complexity: O(n) — Single traversal of the binary string. 💾 Space Complexity: O(1) — Constant extra space for carry and counter variables. 📁 File: https://lnkd.in/emqeMm9h 📚 Repo: https://lnkd.in/g8Cn-EwH 💡 Learned: This problem deepened my understanding of binary arithmetic and carry propagation. Instead of direct numeric operations, I learned how to simulate binary behavior efficiently using strings — a crucial skill for handling large number representations. It also strengthened my logic for simulation problems, where each step mimics low-level arithmetic rules. ✅ Day 96 complete — reduced a long binary trail down to one shining bit! 💡⚙️🧠 #LeetCode #DSA #Python #Binary #BitManipulation #Simulation #Strings #CodingChallenge #100DaysOfCode #DailyCoding #InterviewPrep #GitHubJourney
To view or add a comment, sign in
-
⚡ Day 87 of #100DaysOfDSA – 3Sum Closest 🔍 📌 Problem. no 16: Given an integer array nums and an integer target, find the sum of three integers in nums such that the sum is closest to the target. Implemented an optimized Two-Pointer Approach after sorting the array. ⚡ Runtime: 431 ms – Beats 75.40% of submissions 💾 Memory: 12.59 MB – Beats 39.70% of solutions 💻 Language Used: Python ✅ Status: Accepted – All 106 test cases passed successfully! This problem helped me strengthen my skills in pointer manipulation, array traversal, and optimization of nested loops. It was a great exercise in precision and efficiency under constraints. 🔑 Key Learnings: ✔️ Learned to balance between accuracy and performance ✔️ Gained deeper understanding of sorting and two-pointer techniques ✔️ Improved debugging and edge-case analysis for numerical problems 🎯 Day 87 — A logical yet challenging problem that sharpened my optimization mindset and coding discipline! 💪🔥 #100DaysOfCode #100DaysOfDSA #LeetCode #PythonProgramming #DataStructures #AlgorithmPractice #CodeNewbie #DailyCoding #ProblemSolving #TechJourney #WomenWhoCode #CodeLife #CodingChallenge #DSAChallenge #DeveloperLife #PythonDeveloper #LearnToCode #CodingCommunity #CodeEveryday #SoftwareEngineering #KathirCollegeOfEngineering #KathirCollege #BTechLife #AIDS #FutureEngineer #CodingMotivation #ProgrammingSkills
To view or add a comment, sign in
-
-
🌳 Day 12 of 30 – LeetCode Challenge: Symmetric Tree 🔁 Today’s challenge was about determining if a binary tree is symmetric — meaning it is a mirror of itself around its center. This is a classic Binary Tree + Recursion problem that also builds intuition for mirror-based traversal. 🧩 Problem Summary Given the root of a binary tree, check if it is symmetric. ✅ Example 1 Input: [1,2,2,3,4,4,3] Output: true ❌ Example 2 Input: [1,2,2,null,3,null,3] Output: false 💡 Logic A tree is symmetric if: Left subtree of L mirror-matches Right subtree of R i.e., L.val == R.val L.left mirrors R.right L.right mirrors R.left ⚙️ Complexity Analysis Recursion Time:O(n) Space:O(h) Iterative Time:O(n) Space:O(n) 🏆 Takeaways ✅ Improved understanding of tree symmetry and mirror traversal 🧠 Strengthened concepts of recursion & queue-based BFS 🌱 Setting up a strong foundation for Binary Tree & DFS/BFS concepts #Day12 #LeetCode #BinaryTrees #Recursion #Iteration #Python #WomenWhoCode #DSA #CodingChallenge #30DaysOfCode #MTech #LearningEveryday
To view or add a comment, sign in
-
-
"Day 3 is a massive win for efficiency! I dedicated the morning to mastering the Two-Pointer technique, a critical step in optimizing array algorithms. I successfully tackled two key problems, including the famous Remove Duplicates (#26), which confirmed the absolute necessity of O(1) auxiliary space optimization. Key Technical Insight: O(1) Space is King I compared different approaches for removing duplicates and confirmed the core DSA lesson: 1. The Slow/Fast Pointer method is the correct, efficient approach, achieving O(1) space and O(n) time by manipulating the array in-place. 2. Brute-force solutions using helper data structures violate the memory constraint and often lead to slow O(n^2) time complexity. The lesson is clear: Master the mechanism, don't just rely on the wrapper. Understanding this difference is essential for building scalable applications. All progress is documented and pushed. Now, the plan pivots to laying the foundation for my Python OOP skills and project architecture. #DSA #TwoPointers #Python #LeetCode #SoftwareEngineering #Consistency #O1Space"
To view or add a comment, sign in
-
🔥 Day 11 of 30 – LeetCode Challenge: Search Insert Position 🧠 Today’s problem focuses on Binary Search with a twist—if the target isn’t found in the array, we must determine the correct index where it should be inserted to maintain sorted order. 🧩 Problem Summary Given a sorted array of distinct integers and a target, return: ✅ Index of the target if found 📍 If not found, index where it should be inserted Example 1: Input: nums = [1,3,5,6], target = 5 Output: 2 Example 2: Input: nums = [1,3,5,6], target = 2 Output: 1 Example 3: Input: nums = [1,3,5,6], target = 7 Output: 4 💡 Approach – Binary Search We use binary search to narrow down the potential index. If the target isn’t found, the left pointer will indicate the correct insertion position. ⚙️ Complexity Analysis Time O(log n) Space O(1) 🏆 Key Learnings ✅ Reinforced understanding of binary search 📍 Learned how pointer positions help determine insertion index ⚡ More confidence with boundary-based problems ✨ Real-World Applications 🔹 Auto-suggestion systems (insert new search term) 🔹 Maintaining ordered data lists 🔹 Ranking & leaderboard systems #Day11 #LeetCode #BinarySearch #Python #WomenWhoCode #DSA #ProblemSolving #CodingJourney #MTech #KeepLearning
To view or add a comment, sign in
-
-
🚀 Solved a Classic String-Search Problem! I recently worked on the problem “Find the index of the first occurrence of a string in another string” (LeetCode 28 — strStr()), and it was a great exercise in understanding string manipulation and efficient search techniques. 🔍 Problem Summary Given two strings, haystack and needle, the goal is to return the index of the first occurrence of needle within haystack, or -1 if it doesn’t exist. 🔧 My Approach I implemented two solutions: 1️⃣ Basic Sliding Window Approach Iterate through haystack Compare each substring with needle Return the index when a match is found 2️⃣ Optimized Thought Process (KMP-ready) Explored how KMP can reduce time complexity from O(n*m) to O(n) Understood prefix functions and pattern matching fundamentals 🧠 What I Learned Strengthened understanding of string traversal Learned how to optimize search operations Practiced writing clean and readable code Got a deeper understanding of how real search algorithms (like KMP) work behind the scenes Happy to connect with others exploring DSA, algorithms, and problem-solving! 🚀 #️⃣ #dsa #leetcode #coding #programming #python #softwaredevelopment #algorithms #computerscience
To view or add a comment, sign in
-
-
🚀 𝐃𝐚𝐲 𝟏𝟑 𝐨𝐟 #𝟏𝟔𝟎𝐃𝐚𝐲𝐬𝐎𝐟𝐂𝐨𝐝𝐞 — 𝐏𝐚𝐥𝐢𝐧𝐝𝐫𝐨𝐦𝐞 𝐍𝐮𝐦𝐛𝐞𝐫 | 𝐒𝐭𝐫𝐢𝐧𝐠𝐬 🧩 Today’s focus was on a simple yet classic logic check — determining if a number reads the same forward and backward. While it looks straightforward, it’s a great reminder that elegant solutions often come from clarity, not complexity. Problem: 𝐂𝐡𝐞𝐜𝐤 𝐢𝐟 𝐚𝐧 𝐢𝐧𝐭𝐞𝐠𝐞𝐫 𝐢𝐬 𝐚 𝐩𝐚𝐥𝐢𝐧𝐝𝐫𝐨𝐦𝐞. Approach: Convert the integer to a string and compare it with its reverse. Time Complexity: O(n) Space Complexity: O(n) This small exercise reinforces foundational reasoning that scales up when designing more complex systems — where reversing, mirroring, or symmetry detection shows up in data validation, pattern recognition, and even natural language tasks. 🔗 GitHub: https://lnkd.in/gaim_PJS #Python #LeetCode #CodingChallenge #160DaysOfCode #ProblemSolving #DSA #AIEngineerJourney
To view or add a comment, sign in
-
Day 35 / 100 – Subarray Sum Equals K (LeetCode #560) Today’s challenge was about finding the number of continuous subarrays whose sum equals a given value k. At first, the brute-force approach felt tempting — checking every possible subarray — but that would be too slow. Instead, I learned to use a Hash Map to store cumulative sums and find the solution in linear time. This problem truly deepened my understanding of prefix sums and how storing previous computations can make complex problems simple and elegant. 🔍 Key Learnings Prefix Sum helps keep track of cumulative totals efficiently. Hash Maps allow quick lookups, reducing time complexity from O(n²) to O(n). Sometimes, the key to optimization is remembering what you’ve already calculated. 💭 Thought of the Day Today reminded me that not every problem needs to be solved from scratch — sometimes, the best solutions come from building on what you already know. Logic and memory, when used together, create magic in code ✨ 🔗 Problem Link: https://lnkd.in/gVGGGm6J #100DaysOfCode #Day35 #LeetCode #Python #HashMap #ProblemSolving #DataStructures #Algorithms #CodingChallenge #CodeEveryday #LearningJourney #Optimization #CleanCode #TechGrowth
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