Coder Social home page Coder Social logo

platzimaster / challenge-javascript-06 Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 81.0 584 KB

challenge-javascript-06 - Problema de suma combinada

Home Page: https://platzi.com/clases/learning-path/matematicas-programacion/

License: MIT License

JavaScript 100.00%
javascript math numbers level-medium

challenge-javascript-06's Introduction

challenge-javascript-06 - Problema de suma combinada

Dado un conjunto de números candidatos (candidatos) (sin duplicados) y un número objetivo (objetivo), encuentre todas las combinaciones únicas en candidatos donde los números candidatos suman al objetivo.

Se puede elegir el mismo número repetido de candidatos un número ilimitado de veces.

Nota:

Todos los números (incluido el objetivo) serán enteros positivos. El conjunto de soluciones no debe contener combinaciones duplicadas.

Ejemplo

Input: candidates = [2,3,6,7], target = 7,

A solution set is:
[
  [7],
  [2,2,3]
]
Input: candidates = [2,3,5], target = 8,

A solution set is:
[
  [2,2,2,2],
  [2,3,3],
  [3,5]
]

Instalación

npm install

test

npm run test

RETO

Crea una función que encuentre todas las combinaciones específica sumando los números candidatos para obtener el número objetivo.

Enviar solución de reto

Debes hacer un "Fork" de este proyecto, revolver los problemas y crear un Pull Request hacia este repositorio.

Contribuir

Si alguien quiere agregar o mejorar algo, lo invito a colaborar directamente en este repositorio: challenge-javascript-06

Licencia

challenge-javascript-03 se lanza bajo la licencia MIT.

challenge-javascript-06's People

Contributors

degranda avatar gndx avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

challenge-javascript-06's Issues

New test

Los test se pueden pasar usando dos niveles de iteración, ya que los test actuales son resultados sólo tienen 2 números diferentes.

Sugiero añadir el siguiente test:

expect(combinationSum(combinationSum([2, 3, 5, 7], 17))).toEqual([
  [2, 2, 2, 2, 2, 2, 2, 3],
  [2, 2, 2, 2, 2, 2, 5],
  [2, 2, 2, 2, 2, 7],
  [2, 2, 2, 2, 3, 3, 3],
  [2, 2, 2, 3, 3, 5],
  [2, 2, 3, 3, 7],
  [2, 2, 3, 5, 5],
  [2, 3, 3, 3, 3, 3],
  [2, 3, 5, 7],
  [2, 5, 5, 5],
  [3, 3, 3, 3, 5],
  [3, 7, 7],
  [5, 5, 7]
]);

Update name of project in the README file

Expected Behavior

challenge-javascript-06 se lanza bajo la licencia MIT.

Current Behavior

challenge-javascript-03 se lanza bajo la licencia MIT.

Possible Solution

Edit README file and change name of the project to challenge-javascript-06
#20

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.