Giter VIP home page Giter VIP logo

cheapest-restaurants's Introduction

PROBLEM STATEMENT:

Because it is the Internet Age, but also it is a recession, the Comptroller of the town of Jurgensville has decided to publish the prices of every item on every menu of every restaurant in town, all in a single CSV file (Jurgensville is not quite up to date with modern data serialization methods). In addition, the restaurants of Jurgensville also offer Value Meals, which are groups of several items, at a discounted price. The Comptroller has also included these Value Meals in the file.

Input csv menu file should be in format:

for lines that define a price for a single item:

restaurant ID, price, item label

for lines that define the price for a Value Meal (there can be any number of items in a value meal)

restaurant ID, price, item 1 label, item 2 label, ...

All restaurant IDs are integers, all item labels are lower case letters and underscores, and the price is a decimal number.

Program accepts input csv file, and a list of item labels that someone wants to eat for dinner, and outputs the restaurant they should go to, and the total price it will cost them. It is okay to purchase extra items, as long as the total cost is minimized.

SAMPLE DATA SETS

Here are some sample data sets, program inputs, and the expected result:

Data File data.csv

1, 4.00, burger

1, 8.00, tofu_log

2, 5.00, burger

2, 6.50, tofu_log

Program Input

program data.csv burger tofu_log

Expected Output

2, 11.5

Data File data.csv

3, 4.00, chef_salad

3, 8.00, steak_salad_sandwich

4, 5.00, steak_salad_sandwich

4, 2.50, wine_spritzer

Program Input

program data.csv chef_salad wine_spritzer

Expected Output

nil (or null or false or something to indicate that no matching restaurant could be found)

Data File data.csv

5, 4.00, extreme_fajita

5, 8.00, fancy_european_water

6, 5.00, fancy_european_water

6, 6.00, extreme_fajita, jalapeno_poppers, extra_salsa

Program Input

program data.csv fancy_european_water extreme_fajita

Expected Output

6, 11.0

GETTING STARTED

Make sure you have the input.csv file at the same location from where you are running restaurant.py file.

cheapest-restaurants's People

Contributors

sunilchauhan avatar

Stargazers

Nirav B Suthar avatar

Watchers

 avatar Nirav B Suthar avatar

Forkers

puneetjindal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.