Prefix By Prithwiraj samanta Finding prefix array function prefix(v) { var res = Array(v.length).fill(0); var i = 0; for(i = 1; i < v.length; i++) { res[i] = res[i- 1] + v[i]; } return res; } Share Get link Facebook X Pinterest Email Other Apps Share Get link Facebook X Pinterest Email Other Apps