Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec09b8a

Browse files
refactor 1175
1 parent835a663 commitec09b8a

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

‎src/main/java/com/fishercoder/solutions/_1175.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
packagecom.fishercoder.solutions;
22

3-
/**
4-
* 1175. Prime Arrangements
5-
*
6-
* Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.)
7-
* (Recall that an integer is prime if and only if it is greater than 1,
8-
* and cannot be written as a product of two positive integers both smaller than it.)
9-
* Since the answer may be large, return the answer modulo 10^9 + 7.
10-
*
11-
* Example 1:
12-
* Input: n = 5
13-
* Output: 12
14-
* Explanation: For example [1,2,5,4,3] is a valid permutation, but [5,2,3,4,1] is not because the prime number 5 is at index 1.
15-
*
16-
* Example 2:
17-
* Input: n = 100
18-
* Output: 682289015
19-
*
20-
* Constraints:
21-
* 1 <= n <= 100
22-
* */
233
publicclass_1175 {
244
publicstaticclassSolution1 {
255
publicintnumPrimeArrangements(intn) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp