SubArraySum
Solving problem with javascript really fun. Lets build the basic build blocks. Problem: In an array of integers find the number of combinations of subarray for an expected target. Take a use case in real life, you have $50 in hand. You can pick items next to each other in an aisle. Find how many possibilities. Price of each item given as follows. [10, 12, 38, 20, 10, 5, 15] How do we pick in real life? We can pick items [12, 38] or [20, 10, 5, 15] which are continues. It is easy for us when such a small data provided. Imaging 1000 continues array like below: [ 8, 43, 24, 98, 39, 48, 96, 16, 60, 61, 74, 52, 82, 45, 37, 4, 69, 26, 40, 5, 5, 4, 51, 78, 47, 94, 89, 35, 33, 28, 2, 97, 69, 74, 57, 45, 90, 64, 36, 23, 88, 96, 63, 100, 86, 33, 4, 29, 18, 2, 21, 11, 6, 100, 82, 33, 10, 92, 23, 47, 95, 56, 37, 98, 3, 64, 40, 22, 97, 92, 79, 40, 12, 70, 43, 4, 93, 71, 96, 57, 22, 18, 93, 67, 41, 56, 89, 98, 6, 91, 43, 89, 87, 2, 65, 10, 44, 31, 31, 80, 69, 83, 66, 26,...