We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f5f7af commit b56dba5Copy full SHA for b56dba5
number-of-distinct-averages/index.kt
@@ -0,0 +1,9 @@
1
+package com.github.masx200.leetcode_test.number_of_distinct_averages
2
+
3
+class Solution {
4
+ fun distinctAverages(nums: IntArray): Int {
5
+ nums.sort()
6
7
+ return nums.mapIndexed { i, v -> v + nums[nums.size - 1 - i] }.toHashSet().size
8
+ }
9
+}
pom.xml
@@ -86,6 +86,7 @@
86
</goals>
87
<configuration>
88
<sourceDirs>
89
+ <sourceDir>number-of-distinct-averages</sourceDir>
90
<source>letter-case-permutation</source>
91
<sourceDir>binary-search-tree-iterator</sourceDir>
92
<sourceDir>construct-binary-search-tree-from-preorder-traversal</sourceDir>
0 commit comments