<prompt> Kutokana na integer array nums, kushughulikia maswali mbalimbali ya aina ifuatayo: Mahesabu ya jumla ya vipengele vya nums kati ya faharisi left na right pamoja ambapo left haki. Tumia NumArray darasa: NumArrayint nums Initializes kitu na integer array nums. int sumRangeint kushoto, int kulia Anarudi jumla ya vipengele vya nums kati ya faharisi left na right pamoja ya ni numsleft numsleft 1 ... numsright.  <response>: To implement the NumArray class, you can create a prefix sum array prefix where prefixi is the sum of the elements in nums from 0 to i. Then, sumRangeleft, right can be computed as prefixright - prefixleft-1 assuming left 0. If left is equal to 0, then sumRangeleft, right is simply prefixright. The initialization of prefix can be done in the constructor of the NumArray class. The time complexity of sumRange will be O1. Here is the implementation of the NumArray class:class NumArray private int prefix; public NumArrayint nums prefix new intnums.length; for int i 0; i nums.length; i if i 0 prefixi numsi; else prefixi prefixi-1 numsi; public int sumRangeint left, int right if left 0 return prefixright; else return prefixright - prefixleft-1; You can create an instance of the NumArray class with the input array nums and then call the sumRange method to get the sum of the elements between the specified indices. 