Skip to content

Instantly share code, notes, and snippets.

@14104chk
14104chk / Main.java
Last active November 16, 2022 05:39
private int[] a;
private int[] b;
/**
* @see <a href="https://v2ex.com/t/895464?p=2">see</a>
*/
public void calc(String[] input1, String[] input2) {
a = Stream.of(input1).mapToInt(e -> new BigDecimal(e).multiply(BigDecimal.valueOf(100)).intValue()).sorted().toArray();
b = Stream.of(input2).mapToInt(e -> new BigDecimal(e).multiply(BigDecimal.valueOf(100)).intValue()).sorted().toArray();
if (IntStream.of(a).sum() != IntStream.of(b).sum()) {