Beautiful Arrangement

Описание к видео Beautiful Arrangement

Suppose you have n integers from 1 to n. We define a beautiful arrangement as an array that is constructed by these n numbers successfully if one of the following is true for the ith position in this array:

The number at the ith position is divisible by i.
i is divisible by the number at the ith position.
Given an integer n, return the number of the beautiful arrangements that you can construct.

Problem link: https://leetcode.com/problems/beautif...

Комментарии

Информация по комментариям в разработке