Skip to main content
abhisheks8539
August 23, 2023
Question

Bitwise Or

  • August 23, 2023
  • 3 replies
  • 0 views

a!localVariables(
  local!input1: if(
    len(ri!input2) > len(ri!input1),
    concat(
      a!forEach(
        items: enumerate(len(ri!input2) - len(ri!input1)),
        expression: 0
      ),
      ri!input1
    ),
    ri!input1
  ),
  local!input2: if(
    len(ri!input1) > len(ri!input2),
    concat(
      a!forEach(
        items: enumerate(len(ri!input1) - len(ri!input2)),
        expression: 0
      ),
      ri!input2
    ),
    ri!input2
  ),
  concat(
    a!forEach(
      items: enumerate(len(local!input1)),
      expression: if(
        or(local!input1[fv!index]=1, local!input2[fv!index]=1),
        1,
        0
      )
    )
  )
)

3 replies

August 23, 2023

Hello abhishek, can you please mention the question and the expected result clearly?

abhisheks8539
August 23, 2023

rule inputs are text. i.e.: 10011

anmolv0003
Participating Frequently
August 23, 2023

Anmol