NVIDIA Interview Question

Implement algorithimc problem i C++