All Questions
Tagged with optimization sequence
3
questions
9
votes
3
answers
937
views
Minimum number of flips needed to fully set a binary string
Source: My school teacher, it was just given as a problem statement.
Problem: You are given a binary sequence $S$ of up to $10^6$ bits. You wish to set all the bits in the string to $1$, but the catch ...
12
votes
2
answers
650
views
Arithmetic-progression-free sequences
This question Sudokus with no 3-term arithmetic progressions within made me wonder about the following question.
What is the longest sequence composed of the integers 1..N (or 0..N-1 if you have a ...
5
votes
0
answers
265
views
Longest Fibonacci word
Fibonacci words are defined as $F_0 = a, F_1 = b, F_{n+2} = F_nF_{n+1}$ where $a, b$ are letters. How can you find the longest Fibonacci sub-word in a given string?
Try to solve it in linear time ($O(...