The tag has no wiki summary.

learn more… | top users | synonyms

10
votes
1answer
487 views

Fix unbalanced brackets

Consider the alphabet A ="()[]{}<>". Think of the characters in the alphabet as opening and closing brackets of 4 different types. Let's say that a string over the alphabet A is balanced if it ...
6
votes
9answers
290 views

Group adjacent values

The task is to group adjacent values from collection and output it as a new aggregated collection. Consider we have following input: Sequence Number Value ======== ===== 1 9 2 ...
3
votes
8answers
364 views

The group of sequential positive numbers with the highest sum?

Given the following list of numbers, find the group of sequential positive numbers with the highest sum. Example input: 12 2 35 -1 20 9 76 5 4 -3 4 -5 19 80 32 -1 Example output: 131 The most ...
10
votes
9answers
716 views

Find largest sum of subsequence

Given a sequence of integers find the largest sum of a subsequence (integers on consecutive positions) of the sequence. The subsequence can be empty (in which case the sum is 0). Input is read from ...
9
votes
6answers
879 views

Shortest, lexicographically smallest generating string

A string x generates a string y if y is a substring of an infinite repeat of x. For example abc generates bcabcab. Write a program to find the shortest, lexicographically smallest string that will ...
3
votes
3answers
262 views

Finding “sub-palindromes” 2: subsequences.

The same task as Finding "sub-palindromes" but instead of finding substrings you must find subsequences that are not substrings. eg1: input: "12131331" output: "11", "33", "111", "121", "131", ...