My solution to #1 is way simpler:
type CanMeet<A extends Patient, B extends Patient> = A['state'] extends B['state'] ? true : false
At least it passes all given conditions. I was unable to solve #2 and #3.
Ye you have nail that as the false is only when we have different states. That is very good answer 👍
I guess it's better not to bind the implementation to discriminated field value (state). It should remain variable.
state
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My solution to #1 is way simpler:
At least it passes all given conditions.
I was unable to solve #2 and #3.
Ye you have nail that as the false is only when we have different states. That is very good answer 👍
I guess it's better not to bind the implementation to discriminated field value (
state
). It should remain variable.