give integer array arr integer target return number tuple j k j k arri arrj arrk targetAs answer large return modulo 109 7 Example 1input arr 1122334455 target 8Output 20explanation enumerate value arri arrj arrk1 2 5 occur 8 times1 3 4 occur 8 times2 2 4 occur 2 times2 3 3 occur 2 timesExample 2input arr 112222 target 5Output 12Explanation arri 1 arrj arrk 2 occur 12 timesWe choose 1 11 2 waysand 2s 2222 6 waysExample 3input arr 213 target 6output 1explanation 1 2 3 occur time array return 1 constraints3 arrlength 30000 arri 1000 target 300