A valid cut in a circle can be:
Some valid and invalid cuts are shown in the figures below.
Given the integer n, return the minimum number of cuts needed to divide a circle into n equal slices.
Example 1:
Input: n = 4 Output: 2 Explanation: The above figure shows how cutting the circle twice through the middle divides it into 4 equal slices.
Example 2:
Input: n = 3 Output: 3 Explanation: At least 3 cuts are needed to divide the circle into 3 equal slices. It can be shown that less than 3 cuts cannot result in 3 slices of equal size and shape. Also note that the first cut will not divide the circle into distinct parts.
Constraints:
1 <= n <= 100Solutions for this problem are being prepared.
Try solving it yourselfMinimum Cost to Cut a Stick - Leetcode 1547 - Python • NeetCodeIO • 16,320 views views
Watch 9 more video solutions →Practice Minimum Cuts to Divide a Circle with our built-in code editor and test cases.
Practice on FleetCode