You are not logged in. Please login at to post your questions!


WA brackets "()"

This query is related to the recent long challenge's codecracker question.Can anyone please tell me why solution failed and solution passed even though there is difference in brackets between (I&1)==(K&1) in the twelth line and everything else in the two solutions is the exact same??

asked 14 Sep '15, 21:50

ohil17yo36's gravatar image

accept rate: 10%

edited 14 Sep '15, 21:51

COMPRISON(==) operator has high precedence than BITWISE AND(&) check here.

In the WA solution l&1==k&1 it will be calculated l&(1==k)*1.

For the AC solution "()" do the right job for you as they have the high precedence.

Hope you understood the difference.


answered 14 Sep '15, 22:15

codeman004's gravatar image

accept rate: 25%

edited 14 Sep '15, 22:17

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 14 Sep '15, 21:50

question was seen: 619 times

last updated: 14 Sep '15, 22:17