Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed problem 1 and 2. #115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Use `partners.csv` and `capacities.csv`.
```
D1, 100, T1
D2, 240, T1
D3, 260, T1
D2, 260, T1
```

**OUTPUT**:
Expand Down
15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const problemStatement1 = require('./problem/problem1.js')
const problemStatement2 = require('./problem/problem2.js')
// const { maximumCapacity } = require('./problem2.js')



const Problem = async()=>{

//Problem Solution 1 Call
await problemStatement1.minimumDeliveryCost()
//Problem Solution 1 Call
await problemStatement2.minimumCapacity()
}

Problem()
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions partners.csv → inputs/partners.csv
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Theatre,Size Slab (in GB),Minimum cost,Cost Per GB,Partner ID
T1 ,0-100 ,1500 ,20 ,P1
T1 ,100-200 ,2000 ,13 ,P1
T1 ,200-300 ,2500 ,12 ,P1
T1 ,300-400 ,3000 ,10 ,P1
T2 ,0-100 ,1500 ,20 ,P1
T2 ,100-200 ,2000 ,15 ,P1
T2 ,200-300 ,2500 ,12 ,P1
T2 ,300-400 ,3000 ,10 ,P1
T1 ,0-200 ,1000 ,20 ,P2
T1 ,200-400 ,2500 ,15 ,P2
T2 ,0-200 ,2500 ,20 ,P2
T2 ,200-400 ,3500 ,10 ,P2
T1 ,100-200 ,800 ,25 ,P3
T1 ,200-600 ,1200 ,30 ,P3
T2 ,100-200 ,900 ,15 ,P3
T2 ,200-400 ,1000 ,12 ,P3
Theatre,Size Slab (in GB),Minimum cost,Cost Per GB,Partner ID
T1 ,0-100 ,1500 ,20 ,P1
T1 ,100-200 ,2000 ,13 ,P1
T1 ,200-300 ,2500 ,12 ,P1
T1 ,300-400 ,3000 ,10 ,P1
T2 ,0-100 ,1500 ,20 ,P1
T2 ,100-200 ,2000 ,15 ,P1
T2 ,200-300 ,2500 ,12 ,P1
T2 ,300-400 ,3000 ,10 ,P1
T1 ,0-200 ,1000 ,20 ,P2
T1 ,200-400 ,2500 ,15 ,P2
T2 ,0-200 ,2500 ,20 ,P2
T2 ,200-400 ,3500 ,10 ,P2
T1 ,100-200 ,800 ,25 ,P3
T1 ,200-600 ,1200 ,30 ,P3
T2 ,100-200 ,900 ,15 ,P3
T2 ,200-400 ,1000 ,12 ,P3
4 changes: 0 additions & 4 deletions output1.csv

This file was deleted.

4 changes: 0 additions & 4 deletions output2.csv

This file was deleted.

5 changes: 5 additions & 0 deletions outputs/output1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Problem Statement 1 Output
D1,true ,P1,2000,
D2,true ,P1,3250,
D3,true ,P3,15300,
D4,false ,"",""
6 changes: 6 additions & 0 deletions outputs/output2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Problem Statement 2 Output
D1,true ,P2,3000
D2,true ,P1,3250
D3,true ,P3,15300
D4,false ,"",""

231 changes: 231 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "problem-statement-1",
"version": "1.0.0",
"description": "Qube delivers the movie content to theatres all around the world. There are multiple delivery partners to help us deliver the content.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Kumaran",
"license": "ISC",
"dependencies": {
"csv-parse": "^5.3.1",
"csv-parser": "^3.0.0",
"fast-csv": "^4.3.6"
},
"devDependencies": {}
}
Loading