give integer array num handle multiple query follow typecalculate sum element num index leave right inclusive leave rightimplement NumArray classNumArrayint num Initializes object integer array numsint sumrangeint leave int right return sum element num index leave right inclusive ie numsleft numsleft 1 numsright example 1inputnumarray sumrange sumrange sumrange2 0 3 5 2 1 0 2 2 5 0 5outputnull 1 1 3explanationnumarray numarray new numarray2 0 3 5 2 1numarraysumrange0 2 return 2 0 3 1numarraysumrange2 5 return 3 5 2 1 1numarraysumrange0 5 return 2 0 3 5 2 1 3 constraints1 numslength 104105 numsi 1050 leave right numslengthat 104 call sumrange