Strings and 1D Arrays
Collections of problems involving 1-dimensional arrays of data, with strings being a common variation.
Dated May 28, 2026; last modified on Thu, 28 May 2026
Collections of problems involving 1-dimensional arrays of data, with strings being a common variation.
| Random Link ¯\_(ツ)_/¯ | ||
| May 28, 2026 | » | Rotate Array
2 min; updated May 28, 2026
Given an integer array of length \(N\), rotate the array to the right by \(k\) steps, where \(k \ge 0\). Rotation is periodical, e.g., rotating a 5-item array 13 times yields the same result as rotating it \( 13 \mod 5 = 3\) times. So our effective \(k\) is \(k \mod N\). That \(k \ge 0\) saves us from worrying about how the programming language implements modulo operations . ... |
| May 28, 2026 | » | Minimum Size Subarray Sum
3 min; updated May 28, 2026
Given an array of positive integers This reads like an \(^{n}P_{k}\) permutation problem, where we’re trying to
minimize \(k\) under the constraint that the sum of elements is greater than
|
| May 28, 2026 | » | Is Subsequence
2 min; updated May 28, 2026
Given two lowercase strings, My solution was: … where |
| Jul 21, 2024 | » | Minimum Penalty for a Shop
4 min; updated Jul 21, 2024
Minimum Penalty for a Shop.
ProblemYou are given the customer visit log of a shop represented by a
zero-indexed string |