Giter VIP home page Giter VIP logo

slcsp-python's Introduction

Calculate second lowest cost silver plan (SLCSP)

Already solved. Total execution time: 0.55 sec

Problem

You have been asked to determine the second lowest cost silver plan (SLCSP) for a group of ZIP Codes.

Task

You have been given a CSV file, slcsp.csv, which contains the ZIP Codes in the first column. Fill in the second column with the rate (see below) of the corresponding SLCSP and emit the answer as a CSV on stdout.

Write your code in your best programming language.

Expected output

The order of the rows in your answer as emitted on stdout must stay the same as how they appeared in the original slcsp.csv. The first row should be the column headers: zipcode,rate The remaining lines should output unquoted values with two digits after the decimal place of the rates, for example: 64148,245.20.

It may not be possible to determine a SLCSP for every ZIP Code given; for example, if there is only one silver plan available, there is no second lowest cost plan. Check for cases where a definitive answer cannot be found and leave those cells blank in the output CSV (no quotes or zeroes or other text). For example, 40813,

Additional information

The SLCSP is the so-called "benchmark" health plan in a particular area. It is used to compute the tax credit that qualifying individuals and families receive on the marketplace. It is the second lowest rate for a silver plan in the rate area.

For example, if a rate area had silver plans with rates of [197.3, 197.3, 201.1, 305.4, 306.7, 411.24], the SLCSP for that rate area would be 201.1, since it is the second lowest rate in that rate area.

A plan has a "metal level", which can be either Bronze, Silver, Gold, Platinum, or Catastrophic. The metal level is indicative of the level of coverage the plan provides.

A plan has a "rate", which is the amount that a consumer pays as a monthly premium, in dollars.

A plan has a "rate area", which is a geographic region in a state that determines the plan's rate. A rate area is a tuple of a state and a number, for example, NY 1, IL 14.

There are two additional CSV files in this directory besides slcsp.csv:

  • plans.csv -- all the health plans in the U.S. on the marketplace
  • zips.csv -- a mapping of ZIP Code to county/counties & rate area(s)

A ZIP Code can potentially be in more than one county. If the county can not be determined definitively by the ZIP Code, it may still be possible to determine the rate area for that ZIP Code.

A ZIP Code can also be in more than one rate area. In that case, the answer is ambiguous and should be left blank.

We will want to compile your code from source and run it, so please include the complete instructions for doing so in a COMMENTS file.

slcsp-python's People

Contributors

leninpaulino avatar

Stargazers

 avatar

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.