Pergunta de entrevista da empresa Bloomberg

find target sum elements in array, find max diff in array

Respostas da entrevista

Sigiloso

12 de nov. de 2017

class MaxDifferenceTwoElements { int MaxDifference(int arr[],int arr_size) { int max_diff=arr[1]-arr[0]; int min_elem=arr[0]; for(int i=0;imax_diff) { max_diff=arr[i]-min_elem; } if(arr[i]

Sigiloso

29 de nov. de 2017

Parse array and keep track of min and max and at the end return difference