Domanda di colloquio di 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

Risposta di colloquio

Anonimo

16 ago 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