Pergunta de entrevista da empresa Alarm.com

Algorithm questions: coin change to make a certain value (greedy algorithm works for this one), given an array of numbers, find the max span of indices between two numbers

Resposta da entrevista

Sigiloso

16 de ago. de 2019

For the coin change question, I used a greedy algorithm which worked for the given coin denominations. For the array question, I used a dictionary to store the number and its first index, and a one pass approach to find the max span of indices

1