当前位置:网站首页>2022.4.22-----leetcode. three hundred and ninety-six
2022.4.22-----leetcode. three hundred and ninety-six
2022-04-23 01:45:00 【Lu 727】
// Time out, find the rule ..
public int maxRotateFunction(int[] nums) {
int n=nums.length;
int all=0;
int sum=0;
for(int i=0,j=0;i<n;i++,j++){
sum+=j*nums[i];
all+=nums[i];
}
int max=sum;
for(int i=1;i<n;i++){
sum=sum+all-n*nums[n-i];
max=Math.max(max,sum);
}
return max;
}
版权声明
本文为[Lu 727]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230143495469.html
边栏推荐
- 如何“优雅”的测量系统性能
- Jerry's factors that usually affect CPU performance test results are: [article]
- 关于C4D动画如何导入Lumion
- Technology cloud report: cloud computing has entered the "second half". Where is the way out for domestic cloud?
- W801/W800-wifi-socket开发(二)-UDP蓝牙控制wifi连接
- DFS parity pruning
- Performance introduction of the first new version of cdr2022
- Custom numeric input control
- Unity combines itextsharp to generate PDF preparation DLL
- iTextSharp 基础结构
猜你喜欢
W801/W800/W806唯一ID/CPUID/FLASHID
教程】如何用GCC“零汇编”白嫖MDK
Introduction to PCIe xdma IP core (with list) - mingdeyang science and Education (mdy edu. Com)
W801/W800-wifi-socket开发(二)-UDP蓝牙控制wifi连接
C语言中如何“指名道姓”的进行初始化
Custom numeric input control
CDR2022首发全新版本性能介绍
ai2022新功能,illustrator 2022 新功能介绍
无关联进程间通信 —— 命名管道的创建和使用
W801 / w800 WiFi socket development (II) - UDP Bluetooth control WiFi connection
随机推荐
Itextsharp displays Chinese fonts
iTextSharp 基础结构
Chapter 6 uses Matplotlib to draw thermodynamic diagram
Use yolov4 on colab
The leader / teacher asks to fill in the EXCEL form document. How to edit the word / Excel file on the mobile phone and fill in the Excel / word electronic document?
Glide set fillet image (support custom fillet position)
Is the stable currency a super opportunity to accelerate the death of the public chain or replace BTC?
Leetcode 112 Total path (2022.04.22)
揭秘被Arm编译器所隐藏的浮点运算
力扣(LeetCode)112. 路径总和(2022.04.22)
Completely uninstall antidote 10? What if the antidote uninstall is not clean?
2n皇后问题
客户端项目管理经常面临的挑战
数字藏品平台入驻 数字藏品平台开发 数字藏品SaaS平台
Itextsharp page setup
教程】如何用GCC“零汇编”白嫖MDK
Introduction to PCIe xdma IP core (with list) - mingdeyang science and Education (mdy edu. Com)
CC2541的仿真器CC Debugger使用教程
Oracle database query lock table SQL script and delete lock information script (necessary for database development ETL and DBA)
W801 / w800 WiFi socket development (II) - UDP Bluetooth control WiFi connection