2481. Minimum Cuts to Divide a Circle 發表於 2023-02-13 | 分類於 leetcode problemsloution12345678910class Solution {public: int numberOfCuts(int n) { // n, ret // (1,0) (2,1) (3,3) (4,2) (5,5) (6,3) (7,7) (8,4) (9,9) (10,5) if(n==1) return 0; return n%2==0?n/2:n; }}; analysis time complexity O(1) space complexity O(1)