This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.algoexpert.program | |
fun riverSizes(matrix: List<List<Int>>): List<Int> { | |
val m = matrix | |
.map { it.toMutableList() } | |
.toMutableList() | |
fun size(i: Int, j: Int): Int { | |
if (i < 0 || i >= m.size || | |
j < 0 || j >= m[i].size || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Program { | |
public static List<Integer> riverSizes(int[][] matrix) { | |
var sizes = new ArrayList<Integer>(); | |
for(var i=0; i < matrix.length; i++) { | |
for (var j=0; j < matrix[i].length; j++) { | |
var size = size(i, j, matrix); | |
if (size > 0) { | |
sizes.add(size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Пишет Солженицын: | |
«С другом моим Паниным лежим мы так на средней полке вагон-зака, хорошо устроились, селёдку в карман спрятали, пить не хочется, можно бы и поспать. Но на какой-то станции в наше купе суют — учёного марксиста! это даже по клиновидной бородке, по очкам его видно. Не скрывает: бывший профессор Коммунистической Академии. Свесились мы в квадратную прорезь — с первых же его слов поняли: непробиваемый. А сидим в тюрьме давно, и сидеть ещё много, ценим весёлую шутку — надо слезть позабавиться! Довольно просторно в купе, с кем-то поменялись, стиснулись. | |
— Здравствуйте. | |
— Здравствуйте. | |
— Вам не тесно? |