Skip to content

4182 - 斐波那契序列 #32087

Closed
Closed

Description

@PassionZale
type Fibonacci<
  T extends number,
  No extends 1[] = [1, 1, 1],
  N_2 extends 1[] = [1],
  N_1 extends 1[] = [1]
> = T extends 1 | 2
  ? 1
  : T extends No["length"]
  ? [...N_2, ...N_1]["length"]
  : Fibonacci<T, [...No, 1], N_1, [...N_2, ...N_1]>;

Activity

  1. added
    answer
    zh-CN
    on Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    4182answerzh-CN

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions