package com.lanxi.demo2; import java.util.HashSet; import java.util.Iterator; import java.util.Set; public class Test { public static void main(String[] args) { //引用一个Set集合实现类 Set set=new HashSet(); //添加单个元素 set.add("哈"); set.add("士");…
You are given an array a of length n. We define fa the following way: Initially fa = 0, M = 1; for every 2 ≤ i ≤ n if aM < ai then we set fa = fa + aM and then set M = i. Calculate the sum of fa over all n! permutations of the array a modulo 109 + 7.…