You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Given array [1,2,3,4,5,6,7,8,9,10,11,12] make it [0,0,0,0,1,1,1,1,0,0,0,0]
18
+
//JavaSrcipt INTERMEDIATE PROBLEM
19
+
letgiven_array=[1,2,3,4,5,6,7,8,9,10,11,12]
20
+
letmodi_array=[]
21
+
22
+
for(leti=0;i<given_array.length;i++){
23
+
if(i<4||i>7){
24
+
l=given_array[i]
25
+
l=0
26
+
modi_array.push(l)
27
+
}
28
+
else{
29
+
l=given_array[i]
30
+
l=1
31
+
modi_array.push(l)
32
+
}
33
+
}
34
+
// console.log(modi_array);
35
+
36
+
/*
37
+
Write a function frequencies(arr) that takes in the string:
38
+
"lkazjsdfnvapsifdophoidhjsadlkfjgbplak" and return a hash table containing all the different characters in it as the keys, and the number of times each character is repeated as the values
0 commit comments