Hexaware Technologies Interview Question

They asked me to solve a coding problem that tested both logic and optimization, making sure I could write clean, efficient code under time pressure.