Calculate project total min coast based on the bid amount given by the developer for each project If there is no kind of bid placed for any project then return -1, This means, there must be at least 1 bid for each project or return of -1.
-:Input:-
val numOfProjects = 3
val projectId = arrayOf(1, 2, 0, 1, 2, 0)
val bids = arrayOf(35, 10, 8, 20, 25, 100)
-:Output:-
For Project 0 : Comparing bid amount of Dollar 8 with Dollar 100
For Project 1 : Comparing bid amount of Dollar 35 with Dollar 20
For Project 2 : Comparing bid amount of Dollar 10 with Dollar 25
Min cost for All projects is 38 dollars
And If the input is like
val numOfProjects = 3
val projectId = arrayOf(1, 2, 1, 1, 2, 1)
val bids = arrayOf(35, 10, 8, 20, 25, 100)
Then Output is
No project assigned
Understandings
Project 0 min cost is 8
Project 1 min cost is 20
Project 2 min cost is 10
So, total amount is 8+20+10 = 38