2485

[LeetCode] 2485. Find the Pivot Integer

Given a positive integer n, find the pivot integer x such that: The sum of all elements between 1 and x inclusively equals the sum of all elements bet ......
LeetCode Integer Pivot 2485 Find

力扣---2485. 找出中枢整数

给你一个正整数 n ,找出满足下述条件的 中枢整数 x : 1 和 x 之间的所有元素之和等于 x 和 n 之间所有元素之和。 返回中枢整数 x 。如果不存在中枢整数,则返回 -1 。题目保证对于给定的输入,至多存在一个中枢整数。 示例 1: 输入:n = 8 输出:6 解释:6 是中枢整数,因为 ......
整数 中枢 2485
共2篇  :1/1页 首页上一页1下一页尾页