承接 hxtree/sumfinder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hxtree/sumfinder

Composer 安装命令:

composer create-project hxtree/sumfinder

包简介

This program allows for an integer array to be passed in and will then output all the pairs that add up to the sum.

README 文档

README

SumFinder accepts an array of integers and finds which operands sum equals the desired value.

CI Codacy Badge

Usage

require __DIR__ . '/../vendor/autoload.php';

$sum_finder = new SumFinder();
$sum_finder->setSumValue(10);
$sum_finder->setIntArray(1,1,2,4,4,5,5,5,6,7,9);

/*
 * output all pairs (includes duplicates and the reversed order pairs)
 * [1,9], [1,9], [4,6], [4,6], [5,5], [5,5], [5,5], [5,5], [5,5], [5,5]
 */
echo $sum_finder->getAllPairs() . PHP_EOL;

/*
 * output unique pairs only once (removes the duplicates but includes the reversed ordered pairs)
 * [1,9], [4,6], [5,5], [6,4], [9,1]
 */
echo $sum_finder->getUniquePairs() . PHP_EOL;

/*
 * output the same combo pair only once (removes the reversed ordered pairs)
 * [1,9], [4,6], [5,5]
 */
echo $sum_finder->getComboPairs() . PHP_EOL;

Installation

Via Composer

SumFinder is available on Packagist.

Install with Composer:

composer require hxtree/sumfinder

Examples

Learn how SumFinder can be used through our Docs.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固