Skip to content

Instantly share code, notes, and snippets.

View GolovPavel's full-sized avatar
🏠
Working from home

Golov Pavel GolovPavel

🏠
Working from home
View GitHub Profile
1.
1 2 3
4 5 6
7 8 9
Вывести все обратные диагонали
1
4 2
// f([]) -> true
// f([[1, 2], [4, 2], [2, 1], [3, 1]]) -> true
// f([1, 2]) -> true
// f([1, 2], [3, 6]) -> false
boolean isSimmetric(List<Pair<Integer, Integer>> dots) {
if (dots.size() == 0) {
return true;
}
var minX = Integer.MAX_VALUE;
Ограничения:
O(1) по памяти.
O(N) по времени.
// f([' ', '', ''], 1) -> 3, res = ['%', '2', '0']
// f([], 0) -> 0, res = []
// f(['a', ' ', 'b', '', ''], 3) -> 5, res = ['a', '%', '2', '0', 'b']
// f(['a', ' ', 'b', ''], 3) -> illegalArgumentEx
/**
# Java
1. Collections/
- Иерархия коллекций (Iterable - Collection - Set/List/Queue)
- Основные коллекции и их сложности, внутреннее устройство.
- Конкурентные коллекции.
2. Exceptions.
- Иерархия исключений.
- Checked vs Unchecked.
3. Threads.
@GolovPavel
GolovPavel / java_and_containers.md
Last active December 18, 2020 12:31
Java and Containers
@GolovPavel
GolovPavel / iterm2.md
Created August 27, 2020 21:50 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)