Amazon Interview Question

How to deal with difficult condition?