CSC Generation Interview Question

asked me to write one function it was easy and cleared all test cases on codility. But still they rejected my application. Not sure about the reason. I dont know what they want exactly.