Pergunta de entrevista da empresa NVIDIA

Coding: 1. The two-sum problem (famous DSA problem), both on sorted and unsorted arrays. 2. In an array, for each number, find out if it is greater than all the numbers to the right of it. Then questions about time and space complexity of my solution.

Resposta da entrevista

Sigiloso

6 de dez. de 2023

I opened an online C++ compiler to solve it. I used two pointers for two-sum on a sorted array and map on an unsorted array, and the second one could be done by iterating over the array once from the right side.