Tech Interview

A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!

    • 8 Sep 2017

      Boolean String Value

      Posted at 3:55 am by Admin, on September 8, 2017

      Given a string consisting of only 0, 1, A, B, C where
      A = AND
      B = OR
      C = XOR
      Calculate the value of the string assuming no order of precedence and evaluation is done from left to right.

      Examples:
      Input :
      1A0B1

      Output : 1
      1 AND 0 OR 1 = 1

      Input :
      2
      1C1B1B0A0
      1A0B1

      Output :
      0
      1

      0 Comments
      Posted in Uncategorized

Proudly powered by WordPress.

Theme: Minipress by Obox Themes.