This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function maxSubArray(nums) { | |
let maxSum = nums[0]; // Initialize maxSum to the first element | |
let currentSum = nums[0]; // Initialize currentSum to the first element | |
for (let i = 1; i < nums.length; i++) { | |
// Update currentSum to be the maximum of the current element or the sum of currentSum + current element | |
currentSum = Math.max(nums[i], currentSum + nums[i]); | |
// Update maxSum if the currentSum is greater than maxSum | |
maxSum = Math.max(maxSum, currentSum); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Init | |
$ yum update | |
$ yum upgrade | |
$ yum install bash-complition -y | |
$ yum install epel-release | |
$ yum install bash-complition-extra -y | |
$ init 6 | |
# SSH | |
$ ssh REMOTE_USER@REMOTE_IP -p SSH_PORT |