Code Monkey home page Code Monkey logo

quicksplit's Introduction

Splitwise

I implemented an optimized algorithm which will help groups of people in splitting bills.

Required: Make sure you've C++14 compiler for this to work. in case you don't have C++14 compiler you can use GFG IDE : https://ide.geeksforgeeks.org/kU9QXoPjc9

Sample Test case :

                  4 3
                  0 1 10
                  1 2 5
                  2 3 2
                  1
                  1
                  2 0 7
                  0

Output:

                            ################# WELCOME TO QUICK-SPLIT ####################

                  Enter the number of people and the number of transaction
                  ThankYou!
                  In the next 3 lines please enter the index of the person who paid the amount followed by the index of the person who owe it

                  1 should pay amount $5 to 0
                  2 should pay amount $3 to 0
                  3 should pay amount $2 to 0

                  Do you want to add more transaction ?,if yes then press 1 else press 0
                  Enter the number of transactions you want to addon
                  In the next 1 lines please enter the index of the person who paid the amount followed by the index of the person who owe it

                  1 should pay amount $4 to 2
                  3 should pay amount $2 to 0
                  1 should pay amount $1 to 0

                  Do you want to add more transaction ?,if yes then press 1 else press 0
                  Total number of Transactions occurred are 3

Added extra functionality for updating and adding extra transaction. You can add more trancasitons later after the calculation.

quicksplit's People

Contributors

shivam-parashar avatar

Watchers

James Cloos 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.