Skip to main content
edited title
Link
7Aces
  • 449
  • 1
  • 5
  • 18

Efficient Data Structure for this particular problemholding a graph

Source Link
7Aces
  • 449
  • 1
  • 5
  • 18

Efficient Data Structure for this particular problem

Problem Link - http://opc.iarcs.org.in/index.php/problems/NUMTRIPLE

In my opinion, the problem can be solved by a data structure, that shows how each number is connected to another, and via recursion find the smallest possible value. But my question is, what data structure (most efficient) can hold/represent such data? Also, is there a better (faster) way of solving this problem.

Thanks