canReachfunction
Whether the remaining distinct digits can reach the target sum in the given slots.
Import it
import { canReach } from "@johnmorrisdotca/kazu/cross-sums";
Also exported from: @johnmorrisdotca/kazu
Definition
function canReach(target: number, slots: number, used: readonly number[]): boolean
Parameters
| Name | Type | Description |
|---|---|---|
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. |
Returns
boolean
Whether the remaining distinct digits can reach the target sum in the given slots.
Examples
import { canReach } from "@johnmorrisdotca/kazu/cross-sums";
console.log(canReach(10,2,[1]));trueWhat it prints (run when this page was built)