LeetCode Collection
One-Liner Gallery
Problems whose shortest Kotlin or Rust solution is two nonblank lines or less.
65 entries
Focused gallery for this signal, ordered by the strongest matching metric.
02.06.2024
easy344. Reverse String
Reverse an array
04.03.2025
medium1780. Check if Number is a Sum of Powers of Three
Number as the sum of distinct powers of 3
23.10.2023
easy342. Power of Four
Is n == x^4?
2.05.2023
easy1822. Sign of the Product of an Array
There is an sign function in kotlin, but leetcode.com doesn't support it yet.
15.10.2023
hard1269. Number of Ways to Stay in the Same Place After Some Steps
Number of ways to return to 0 after moving left, right or stay steps time
15.11.2023
medium1846. Maximum Element After Decreasing and Rearranging
Max number from converting array to non decreasing
07.09.2025
easy1304. Find N Unique Integers Sum up to Zero
Any n uniq numbers with sum of 0
06.05.2025
easy1920. Build Array from Permutation
n[n[i]]
19.02.2024
easy231. Power of Two
Is number 2^x?
27.06.2024
easy1791. Find Center of Star Graph
Center of a start graph
3.07.2025
easy3304. Find the K-th Character in String Game I
kth char after appending rotated self
05.11.2024
medium2914. Minimum Number of Changes to Make Binary String Beautiful
Min changes to make even-sized 0 and 1
25.10.2025
easy1716. Calculate Money in Leetcode Bank
Add increasing sum of money, drop weekly gain on mondays
11.09.2024
easy2220. Minimum Bit Flips to Convert Number
Bit diff between two numbers manipulation
17.01.2025
medium2683. Neighboring Bitwise XOR
Can restore next-sibl-xored array?
20.02.2024
easy268. Missing Number
Missing in [0..n] number.
22.08.2024
easy476. Number Complement
Invert bits: 101 becomes 010 manipulation
01.06.2024
easy3110. Score of a String
Sum(abs(window))
02.02.2025
easy1752. Check if Array Is Sorted and Rotated
Is array sorted and rotated?
1.10.2023
easy557. Reverse Words in a String III
Reverse words
05.03.2025
medium2579. Count Total Number of Colored Cells
Arithmetic sum
17.03.2025
easy2206. Divide Array Into Equal Pairs
All numbers in pairs
16.12.2023
easy242. Valid Anagram
#### Join me on Telegram
01.02.2025
easy3151. Special Array I
All siblings even-odd
12.03.2025
easy2529. Maximum Count of Positive Integer and Negative Integer
Max positive count or negative count search
24.04.2026
easy2833. Furthest Point From Origin
Max dist when replace with L or R
07.12.2023
easy1903. Largest Odd Number in String
Largest odd number in a string
21.01.2024
medium198. House Robber
Max sum to rob non adjacent items in array.
09.01.2025
easy2185. Counting Words With a Given Prefix
Count words with prefix
29.04.2024
medium2997. Minimum Number of Operations to Make Array XOR Equal to K
Bit diff between k and nums xor manipulation
09.04.2025
easy3375. Minimum Operations to Make Array Values Equal to K
Count number bigger than k
01.08.2024
easy2678. Number of Senior Citizens
Count filtered by a substring
03.08.2024
easy1460. Make Two Arrays Equal by Reversing Subarrays
Can arr transform to target by rotating subarrays?
05.02.2024
easy387. First Unique Character in a String
First non-repeating char position.
1.07.2024
easy1550. Three Consecutive Odds
Has window of 3 odds?
08.03.2025
easy2379. Minimum Recolors to Get K Consecutive Black Blocks
Min 'W' flips to make k 'B' window
22.09.2024
hard440. K-th Smallest in Lexicographical Order
k lexicographically smallest value from 1..n
07.01.2025
easy1408. String Matching in an Array
All substrings
16.02.2023
easy104. Maximum Depth of Binary Tree
Let's write a one-liner.
11.02.2025
medium1910. Remove All Occurrences of a Substring
Remove substring recursively
15.12.2023
easy1436. Destination City
#### Join me on Telegram
02.10.2024
easy1331. Rank Transform of an Array
Array values to their sorted set positions
02.12.2024
easy1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence
Position of the prefix
03.03.2025
medium2161. Partition Array According to Given Pivot
Partition around p
25.09.2023
easy389. Find the Difference
Strings difference by a single char
10.03.2024
easy349. Intersection of Two Arrays
Intersection of two nums arrays
12.09.2024
easy1684. Count the Number of Consistent Strings
Count words with allowed characters
18.05.2023
medium1557. Minimum Number of Vertices to Reach All Nodes
Find all starting nodes in graph.
08.04.2025
easy3396. Minimum Number of Operations to Make Elements in Array Distinct
Count removals 3-prefixes to deduplicate
27.05.2024
easy1608. Special Array With X Elements Greater Than or Equal X
Count of more or equal nums[i] equal itself
06.02.2024
medium49. Group Anagrams
Group words by chars in them.
09.03.2024
easy2540. Minimum Common Value
First common number in two sorted arrays
07.06.2023
medium1318. Minimum Flips to Make a OR b Equal to c
Minimum a and b Int bit flips to make a or b == c.
18.02.2023
easy226. Invert Binary Tree
Let's write a recursive one-liner.
06.03.2024
easy141. Linked List Cycle
Detect cycle
14.01.2025
medium2657. Find the Prefix Common Array of Two Arrays
A[..i] and B[..i] intersections sizes
25.10.2023
medium779. K-th Symbol in Grammar
Binary Tree 0 -> 01, 1 -> 10 at [n][k] position
20.04.2025
medium781. Rabbits in Forest
Count total rabbits from other numbers
04.11.2023
medium1503. Last Moment Before All Ants Fall Out of a Plank
Max time ants on a line when goint left and right
06.06.2023
easy1502. Can Make Arithmetic Progression From Sequence
Is IntArray can be arithmetic progression?
13.06.2024
easy2037. Minimum Number of Moves to Seat Everyone
Sum of diffs of sorted students and seats
5.12.2022
easy876. Middle of the Linked List
fun middleNode(head: ListNode?, fast: ListNode? = head): ListNode? =
4.09.2023
easy141. Linked List Cycle
Detect a cycle in a LinkedList
02.03.2025
easy2570. Merge Two 2D Arrays by Summing Values
Merge two ascending [key, value] lists
10.01.2023
easy100. Same Tree
fun isSameTree(p: TreeNode?, q: TreeNode?): Boolean = p == null && q == null ||