I tried with various example the answer looks correct to me. Please help!