# Questions tagged [subsequences]

101 questions
Filter by
Sorted by
Tagged with
61 views

### Longest Fibonacci word

We define Fibonacci words as: $F_0 = a, F_1 = b, F_{n+2} = F_n F_{n+1}$, $a, b$ can be any symbols. How can we find the longest Fibonacci sub-word in a given string in linear time? This question is ...
31 views

### Analysis of this (palindrome) sequence

This may be a simple problem ultimately. I am picturing a “rule” of “relative enumeration”. Let’s say you start with “19”. This means, there was another choice you missed - implying that you will ...
31 views

57 views

### How can I efficiently generate the shortest list of arguments for the range() function that will generate a given list of integers?

I ran into an interesting problem at work when trying to generate the inputs for an API given the expected output. I've tried to formalize and anonymize the problem below. I've been trying to design a ...
1 vote
723 views

### Counting number of perfect squares in an subarrays

A sequence is good if the bitwise AND of all its elements is a perfect square. So counting number of "good" sequences, in a subarray . For example : in [1, 2, 3] There are 6 sub-sequences: So ...
1 vote
332 views

### DFA for strings with number of 0's odd only in substring longer than 1

I'm trying to design and DFA that accept string with an odd number of 0s, but counting only the ones within sub-strings with two or more 0. So, for example, 011000, will be accepted since it has 4 0...