Questions tagged [subsequence]

A subsequence is a sequence obtained by deleting some elements and retaining the relative order of the remaining elements. It is a generalization of substring which contains only consecutive elements of the original sequence.

A subsequence is a sequence obtained by deleting some elements and retaining the relative order of the remaining elements. It is a generalization of substring which contains only originally consecutive elements.

303 questions
-4
votes
4 answers

Program in C that checks a number's digit subsequences

i need to make a program that for example when given the number 879 must check whether the number is prime and whether all its digits subsequences are prime meaning 87,79,8,7,9 etc. So far i've made a function thats check whether a number is prime…
loukdi
  • 9
  • 2
-4
votes
2 answers

How to get information about subsequences from the array of numbers?

I have an array of numbers (C#): int[] seq = new[] { 2, 1, 4, 2, 1, 3, 0, 0, 0, 0, 0, 1, 5, 2, 3, 7, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; For the sequence above I need something like this: "Group1" - [0, 0, 0, 0, 0] "Group2" - [0,…
-5
votes
1 answer

Repeated subsequence containing all items in python

Imagine that we have a list like [255,7,0,0,255,7,0,0,255,7,0,0,255,7,0,0] We want to find the shortest common subsequence (NOT SUBSTRING) that contains all the items in the subsequence which will be 255,7,0,0 in this case but we don't know the…
1 2 3
20
21