Pergunta de entrevista da empresa Garmin

Write a function whose parameters are an array of integers, and its length. Return the difference between the maximum and minimum element.

Respostas da entrevista

Sigiloso

16 de mar. de 2020

Typing (in C) on their notebook app on their laptop.

Sigiloso

22 de fev. de 2021

int findDifference(int a[], int n) { int min = INT_MAX; int max = INT_MIN; for (int i = 0 ; i max) max = a[i]; } return (max-min); }