You are viewing a single comment's thread. Return to all comments →
Haskell
module Main where import Data.Bits (xor) solve :: Int -> Int -> Int solve l r = maximum [a `xor` b | a <- [l .. r - 1], b <- [a .. r]] main :: IO () main = do l <- readLn :: IO Int r <- readLn :: IO Int print $ solve l r
Seems like cookies are disabled on this browser, please enable them to open this website
Maximizing XOR
You are viewing a single comment's thread. Return to all comments →
Haskell