canReach関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Whether the remaining distinct digits can reach the target sum in the given slots.
インポート
import { canReach } from "@johnmorrisdotca/kazu/cross-sums";
ほかのエクスポート元: @johnmorrisdotca/kazu
定義
function canReach(target: number, slots: number, used: readonly number[]): boolean
引数
| 名前 | 型 | 説明 |
|---|---|---|
target | number | The required digit total still to reach. |
slots | number | The number of remaining distinct digits. |
used | readonly number[] | Digits already used in this run. |
戻り値
boolean
Whether the remaining distinct digits can reach the target sum in the given slots.
例
import { canReach } from "@johnmorrisdotca/kazu/cross-sums";
console.log(canReach(10,2,[1]));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。