Skip to content

Instantly share code, notes, and snippets.

--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@vishal7201
vishal7201 / Balance the Array
Created May 9, 2018 09:11 — forked from mmloveaa/Balance the Array
Balance the Array
Michael gives an array A={a1, a2,. .., aN} to Dwight. Michael then asks Dwight to find out whether there exists an element
in the array such that the sum of elements on its left is equal to the sum of elements on its right.
In other words, is there an index i such that, a1+a2...ai-1 = ai+1+ai+2...aN.
Complete the function balanceSum to help Dwight answer that question.
Note: If there are no elements to the left or to the right, then that sum is considered to be zero.
Constraints
1 ≤ N ≤ 105
1 ≤ Ai ≤ 2x104 where 1 ≤ i ≤ N
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
curl -Ok https://repo.continuum.io/archive/Anaconda3-4.1.1-MacOSX-x86_64.sh
bash Anaconda3-4.1.1-MacOSX-x86_64.sh -b -p ~/anaconda
rm Anaconda3-4.1.1-MacOSX-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bash_profile