@jiminp/tooltool
    Preparing search index...

    Variable bisectConst

    bisect: {
        (sorted_arr: number[], target: number): number;
        (sorted_arr: bigint[], target: bigint): number;
    } = bisectRight

    Alias for bisectRight.

    Type Declaration

      • (sorted_arr: number[], target: number): number
      • Finds the rightmost insertion point for target in a sorted array.

        If target exists, returns the index after any equal entries. (Like Python's bisect_right.)

        Parameters

        • sorted_arr: number[]

          Sorted array (ascending).

        • target: number

          Value to locate.

        Returns number

        Insertion index.

        O(log n). Behavior is undefined if array is not sorted.

        bisectRight([1, 2, 4, 4, 6], 4); // 4
        bisectRight([1, 2, 4, 4, 6], 3); // 2
      • (sorted_arr: bigint[], target: bigint): number
      • Finds the rightmost insertion point for target in a sorted array.

        If target exists, returns the index after any equal entries. (Like Python's bisect_right.)

        Parameters

        • sorted_arr: bigint[]

          Sorted array (ascending).

        • target: bigint

          Value to locate.

        Returns number

        Insertion index.

        O(log n). Behavior is undefined if array is not sorted.

        bisectRight([1, 2, 4, 4, 6], 4); // 4
        bisectRight([1, 2, 4, 4, 6], 3); // 2