Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

array res:=(0,0,0,0,0,0,0,0,0,0)

n:=10
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res:=res[a]+1;
endif
next
next
aux1:=0
aux2:=0

for c:=1 to
if res[a] > aux then
aux1:= res[a];
aux2:= a;
endif
next

print 'Rep:' aux1;


println 'Val:' aux2;
[11:03 p. m., 14/9/2021] Omar GyG: auxa:=0
auxb:=0
n:=10
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res[a]:=res[a]+1
endif
next
next
for c:=1 to n
if res[a] > auxa then
auxa:= res[a]
auxb:= a
endif
next
-------------
array res:=(0,0,0,0,0,0)
n:=6
aux:=0
x:=0
cont:=0
for a:=1 to n
for b:=1 to n
aux:= myArray[a] + myArray[b]
if aux = 10 then
x:=x+1
res[x]:=myArray[a]
b:=n
endif
aux:=0
next
next

for a:=1 to n
if res[a] > 0 then
print res[a]
if cont = 0 then
print ' '
cont:=1
endif
endif
next
----------------------------
SELECT APPX_department.department_name, count(*),
SUM(APPX_employee.salary)
FROM APPX_employee inner join APPX_department on
APPX_employee.department_id=APPX_department.id
group by APPX_employee.department_id order by
SUM(APPX_employee.salary) asc
-----------------------

array res:=(0,0,0,0,0,0,0,0,0,0)
auxa:=0
auxb:=0
n:=10

for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res[a]:=res[a]+1
endif
next
next

for c:=1 to n
if res[c] > auxa then
auxa:= res[c]
auxb:= c
endif
next

println 'Longest: '+ auxa


println 'Number: '+ auxb
_-------------------------------
SELECT APPX_department.department_name, count(*)
FROM APPX_employee inner join APPX_department on
APPX_employee.department_id=APPX_department.id group by
APPX_employee.department_id having count(*) >=2
order by APPX_department.department_name asc
-----------------------
array res:=(0,0,0,0,0,0,0,0,0,0)
auxa:=0
auxb:=0
n:=10
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res[a]:=res[a]+1
endif
next
next

for c:=1 to n
if res[c] > auxa then
auxa:= res[c]
auxb:= c
endif
next

println 'Longest: '+ auxa


println 'Number: '+ auxb
-------------

array res:=(0,0,0,0,0,0,0,0,0,0)

n:=10
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res:=res[a]+1;
endif
next
next
aux1:=0
aux2:=0

for c:=1 to
if res[a] > aux then
aux1:= res[a];
aux2:= a;
endif
next

print 'Rep:' aux1;


println 'Val:' aux2;
------------------

array res:=(0,0,0,0,0,0,0,0,0,0)

n:=10
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res:=res[a]+1;
endif
next
next
aux1:=0
aux2:=0

for c:=1 to
if res[a] > aux then
aux1:= res[a];
aux2:= a;
endif
next

print 'Rep:' aux1;


println 'Val:' aux2;
[9:46 p. m., 20/10/2021] Jeicot Rodriguez: res[a]:=res[a]+1
[9:46 p. m., 20/10/2021] Jeicot Rodriguez: auxa:=0
auxb:=0
n:=10
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res[a]:=res[a]+1
endif
next
next
for c:=1 to n
if res[a] > auxa then
auxa:= res[a]
auxb:= a
endif
next
-----------------------------------------------------
array res:=(0,0,0,0,0,0,0,0,0,0)

n:=9
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res[a]:=res[a]+1
endif
next
next

auxa:=0
auxb:=0
for c:=1 to n
if res[c] > auxa then
auxa:= res[c]
auxb:= myarray[c]
endif
next
println 'Rep:' +' '+ auxa
println 'Val:' +' '+ auxb

---------------------------------------------
array res:=(0,0,0,0,0,0,0,0,0,0)

n:=9
for a:=1 to n
for b:=1 to n
if myArray[a] = myArray[b] then
res[a]:=res[a]+1
endif
next
next

auxa:=0
auxb:=0
for c:=1 to n
if res[c] > auxa then
auxa:= res[c]
auxb:= myarray[c]
endif
next
println 'Rep:' +' '+ auxa
println 'Val:' +' '+ auxb

-------------------------------

public static void main (String args[]) {


// Your code here
Map<Integer,Integer> veces = new HashMap();
for ( int i=0 ; i < myArray.length ; i++){
if ( veces.containsKey(myArray[i] )){
Integer valor = veces.get(myArray[i]);
valor++;
veces.put(myArray[i],valor);
} else {
veces.put(myArray[i],1);
}
}
Integer longest=0;
Integer number=0;
for (Map.Entry<Integer,Integer> resultado: veces.entrySet()){
if (resultado.getValue()>number){
longest = resultado.getKey() ;
number = resultado.getValue() ;
}
}
System.out.println ("Longest: " + number);
System.out.println ("Number: " + longest);
}

You might also like