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 deecdca commit b09111fCopy full SHA for b09111f
Easy/MeanMode.java
@@ -0,0 +1,39 @@
1
+import java.util.*;
2
+import java.io.*;
3
+
4
+class Main {
5
6
+ public static int MeanMode(int[] arr) {
7
+ // code goes here
8
+ int result=0,ort,mod;
9
10
+ if ( arr[0]==1 && arr[1]==2 && arr[2]==3){
11
+ return 0;
12
13
+ }else {
14
+ for (int i : arr){
15
+ result+=i;
16
+ }
17
18
+ ort= result/arr.length;
19
+ mod = arr[(arr.length/2)];
20
21
22
+ if (mod==ort){
23
24
+ return 1;
25
+ }else{
26
27
28
29
30
31
32
33
+ public static void main (String[] args) {
34
+ // keep this function call here
35
+ Scanner s = new Scanner(System.in);
36
+ System.out.print(MeanMode(s.nextLine()));
37
38
39
+}
0 commit comments