the "no infinite money loops" thing and low number of nodes hinted floydwarshall to me, which imo is the easiest to implement since its just 3 for loops.
@dhanvishyam83866 күн бұрын
heyy i couldn't understand what type of problem it was. I was confused when someone commented that this was a graph problem. How did you identify that this was a graph problem
@ManishKumar-kw7qe5 күн бұрын
hints:1.look at the language of the questions--> it is very similar to a graph question " that you can convert from startCurrencyi to targetCurrencyi at a rate of rates1[i]" it is similar to you can move to node v from node u at a cost of c. 2.-->at the last you want the maxAmount of a src node (initialCurrency) this pattern is more similar to shortest distance questions,although it is not a one out of them because here we have to maximise something