DSA Round:
Given a multi-level boolean query find the level of a given term.
Input:
query = A AND (B OR C)
term = B
Output: 1
Input:
query = A AND (B OR C)
term = A
Output: 0
Input:
query = A AND (B OR C)
term = D
Output: -1
Input
query = B AND ((A AND B))
term = B
Output = 1
Explanation: if operand id ocurring multiple times consinder deepest level.
Input:
query = A AND B OR C
term = B
Output: 0
Input
query = ((A))
term = A
Output = 0
Boolean operators -> [AND, OR]
Operands can be string with spaces(not a singe char) -> ["fee foo", "oper"]
Looking forward to solution for this.
Result: Rejected.