X interview question

standard hackerrank problems