Спершу логіка, у вигляді псевдокоду
Дає алгоритм простими кроками до будь-якого справжнього коду.
«Slash-коди» Claude: код / технології
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.