const result = Object.values(arr.reduce((max, n) => (
max[n.group] = +max[n.group]?.score > +n.score ? max[n.group] : n,
max
), {}));function group(data, key, val = n => n) {
const getKey = key instanceof Function ? key : n => n[key];
const getVal = val instanceof Function ? val : n => n[val];
const result = new Map;
for (const n of data) {
const k = getKey(n);
result.set(k, result.get(k) ?? []).get(k).push(getVal(n));
}
return result;
}
function max(data, key = n => n) {
const getVal = key instanceof Function ? key : n => n[key];
let result = null;
for (const n of data) {
const val = getVal(n);
result = result?.[1] >= val ? result : [ n, val ];
}
return result?.[0];
}const result = Array.from(
group(arr, 'group').values(),
n => max(n, m => +m.score)
);
Я пытаюсь открыть эту директорию чтобы открыть и скорректировать файл pg_hba.conf, чтобы поменять METHOD с md5 на trust.
private ArrayList<Lesson> lessons = new ArrayList<Lesson>();
@Override
public int addLesson(Lesson lesson) {
lessons.add(lesson);
return lessons.size();
}
public void toLeft(String[][] arr) {
String tmp;
for(int i = 0, outLen = arr.length; i < outLen; i++) {
for(int j = 0, inLen = arr[i].length; j < inLen; j++) {
if((j + 1) < inLen) {
tmp = arr[i][j];
arr[i][j] = arr[i][j+1];
arr[i][j+1] = tmp;
} else
arr[i][j] = "0";
}
}
}toLeftпередать двумерный массив строк(как указано в задаче) - String[][] arr = {
{"2020", "2019", "2018"},
{"4", "5", "6"},
{"777", "87", "999"},
};
toLeft(arr);for(int i = 0, outLen = arr.length; i < outLen; i++) {
for(int j = 0, inLen = arr[i].length; j < inLen; j++)
System.out.format("%s ", arr[i][j]);
}
// Результат это примера будет такой: 2019 2018 0 5 6 0 87 999 0 \section*{Aufgabe 1}
F\"ur welche nat\"urlichen Zaheln $n$ gilt die Ungleichung
\[
2^n \geq n^2, \quad \forall n \geq 4.
\]
Beweise:
Der Induktionsanfang für $n=4$ ergibt sich mit
\[
2^4 = 16 \geq 16= 4^2.
\]
Der Induktionsshritt:
\begin{equation*}
\begin{split}
2^{n+1} = 2 \times 2^n & \geq 2 \times n^2 = n^2 + n \times n \\
& \geq n^2 + 4 \times n = n^2 + 2 \times n + 2 \times n \\
& \geq n^2 + 2 \times n + 2 \times 4 \\
& \geq n^2 + 2 \times n + 1 = (n + 1)^2
\end{split}
\end{equation*}