GithubHelp home page GithubHelp logo

makechange's Introduction

makeChange

DESAFIO da empresa Daitan:

Infinite Coins Given an infinite number of quarters (25 cents), dimes (10 cents), nickels (5 cents) and pennies (1 cent), write a method makeChange() to calculate and return a Set containing the ways of representing n cents using those coins. Each element of the returned Set should represent the number of coins to compose the entry value, an array like this: [quarters, dimes, nickels, pennies]. The method makeChange() can use a Set data structure to store each representation of n cents, and then, return it. A Set is a collection that contains no duplicate elements and the order of elements is irrelevant. Consider the following interface defined for Set: Method signature Method description boolean add(Element e) Adds the specified element to this set if it is not already present (optional operation). boolean addAll(Set s) Adds all elements from s that are not already present in this set. boolean contains(Element e) Returns true if this set contains the specified element. boolean equals(Set s) Compares the specified set s with this set for equality. Iterator iterator() Returns an iterator over the elements in this set. boolean remove(Element e) Removes the specified element from this set if it is present (optional operation). int size() Returns the number of elements in this set (its cardinality). Element[] toArray() Returns an array containing all of the elements in this set.

makechange's People

Contributors

deniseschirmer avatar

Watchers

 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.