# 2481. Minimum Cuts to Divide a Circle ###### tags: `Leetcode` `Easy` `Math` Link: https://leetcode.com/problems/minimum-cuts-to-divide-a-circle/description/ ## 思路 找规律 如果n是奇数 说明要切n刀 如果n是偶数 要切n/2刀 ## Code ```java= class Solution { public int numberOfCuts(int n) { if(n==1) return 0; return n%2==0?(n/2):n; } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up