We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I use C language, '0' and '1' are represented as character 1 byte each. in ascii table '0' = 48 = 0011000 and '1' = 49 = 00110001.
I use this trick, ((char1 | char 2) & 1). it will return 1 if at least one of the character is equal to '1', do it for every character in column. it really works :D.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
I use C language, '0' and '1' are represented as character 1 byte each. in ascii table '0' = 48 = 0011000 and '1' = 49 = 00110001.
I use this trick, ((char1 | char 2) & 1). it will return 1 if at least one of the character is equal to '1', do it for every character in column. it really works :D.