Сначала логика, в виде псевдокода
Даёт алгоритм простыми шагами до любого настоящего кода.
Коды «slash»: код / технологии
Write pseudocode for [PROBLEM OR FEATURE]. Plain numbered steps, no language-specific syntax. Show inputs, outputs, the main loop or recursion, and how edge cases are handled: empty input, very large input, invalid input. After the pseudocode, state the time and space complexity in one line each.