Thanks @Robert Cemper
Here is my Github repo: github.com/abdul-manaan/AOC24-ObjectScript
Happy Holidays!
Certifications & Credly badges:
Abdul has no Certifications & Credly badges yet.
Global Masters badges:
Abdul has no Global Masters badges yet.
Followers:
Following:
Abdul has not followed anybody yet.
I based my solution for 24.2 on the following equation (found by manually reading/understanding the input):
Equation:
zN = A ⊕. B
zN = [xN ⊕ yN]. ⊕. ( [xN−1∧yN−1] ∨ [input gates of zN−1 w/ AND])
In the input, for each zN, the equation defines the relationship A <OP> B = zN. If the operator <OP> is not XOR, this is incorrect. In such cases, zN needs to be swapped with tN, where tN can be derived using the property: A⊕B=tN.
Similarly, if the values A and B found using the above equation do not match the input gates of XOR for zN, this indicates an intermediate gate (either A or B) needs to be swapped to satisfy the conditions.