Back to Browse

GFG POTD: Palindrome Binary | Bit-Magic Palindrome (Java) | Day 05

6 views
May 4, 2026
8:46

Welcome to today's explanation of the GFG POTD (Problem of the Day)! In this video, I break down the strategies, ideas, and core concepts you need to solve the "Palindrome Binary" problem. Understanding these underlying data structures will boost your overall problem-solving skills and help you build the intuition to tackle similar questions on your own next time. If you found this video helpful, please show your gratitude by liking the video, and don't forget to subscribe to the channel for more daily coding content. Happy coding! Problem Name: Palindrome Binary Difficulty: Easy Platform: GeeksforGeeks Question: Given an integer n, determine whether its binary representation forms a palindrome. Return true if the binary representation of n is a palindrome; otherwise, return false. Note: A binary representation is considered a palindrome if it reads the same forward and backward. The Approach: 1. Convert toBinaryString : Convert the given number into binary String using custom function Integer.toBinaryString(n) 2. Taking variable : A boolean variable is taken to store the answer and took two pointers start and end . 3.Check palindrome: each and every time checking if s[start] != s[end] then break the loop storing answer as false if not then increment start by one and decrement end by one . till then start less than or equals end 4. after iterating through whole loop return the answer Complexity : Time Complexity: O(logN), where N is the value of the input number. Space Complexity: O(1), as we use only a few integer variables. #gfg #dsa #starters #coding #problemoftheday #java #bitmanipulation #bitwiseoperators #sorting #logNcomplexity #easyquestion #leetcode #competitiveprogramming #hike #flipkart #microsoft #adobeillustrator Solution : https://github.com/Arnab-Pachal1234/GFG-POTD-SOLUTION

Download

0 formats

No download links available.

GFG POTD: Palindrome Binary | Bit-Magic Palindrome (Java) | Day 05 | NatokHD