JFrog interview question

Write an efficent algorithm, explain it and its performace limitations