Interesting solution using binary representation for general case

(topic withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Click here to start solving coding interview questions