The runtime of this optimized solution is O(N * log N + N * log N * log N), with O(N) extra space. classSolution {classBinaryIndexedTree {int[] ft; BinaryIndexedTree(intn) { ft=newint[n]; }intrangeSum(intr) {intsum = 0;for(; r > 0; r -= (r & (-r))) { sum+=...