Samsung Electronics Interview Question

implementation of library functions