Techgig Code Gladiators 2022 finale question

Revision en1, by gaurav1903, 2022-08-19 23:05:35

Statement- There are n shops in a circular pattern .Each shop has a requirement of object x given in an array. By mistake orders were shuffled and now wrong orders were delivered to each shop. Now they hired a person to sort this mess.This person would charge 1 USD for taking 1 unit of x by 1 unit distance. Assuming shops are arranged in a circle where 2 closest shops have 1 unit distance between them. What is the minimum cost needed for them to get exactly what they required?

Any help is appreciated or if you could guide me towards a similar problem.

Tags @errichto, techgig, codegladiators, um_nik

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gaurav1903 2022-08-19 23:05:35 605 Initial revision (published)