Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Group 4

Algorithm Group 4

Algorithm Group 4 contains five exercises focused on comparing multiple collections, generating combinations, finding shared values, selecting values by distance, and detecting common adjacent pairs.

Several tasks in this group operate on multiple slices representing independent datasets that must be compared with one another.

Tasks

Task 1 — Collection Equality

Determine whether three integer slices contain the same values even when those values appear in different orders.

Task 2 — Three-Element Average Combinations

Generate every unique combination of three different elements from an integer slice and count how many combinations have an average greater than a specified threshold.

Task 3 — Common Values

Find all integer values that appear in each of three input slices.

Task 4 — Closest Values to Target

For each input slice, identify the two values that are closest to a specified target value.

Task 5 — Common Adjacent Pairs

Find adjacent value pairs that appear in more than one input slice and report which slices contain each pair.

Objectives

The exercises in this group provide practice with:

  • collection comparison
  • ordering independence
  • frequency and membership analysis
  • combinations
  • arithmetic averages
  • intersection of multiple collections
  • distance calculations
  • nearest-value selection
  • adjacent element processing
  • pair comparison
  • result deduplication
  • deterministic output

Collection Relationships

Unlike some earlier groups, the slices in this group generally represent independent collections.

Their values may appear:

  • in different orders
  • only in some collections
  • multiple times
  • next to different neighboring values

The implementation should therefore distinguish between value membership, position, and adjacency depending on the task.

Implementation

The examples define the intended behavior for the provided data, but each implementation should solve the general problem.

Where the original specification contains an ambiguity or an inconsistent example, the individual task page provides a clarified requirement while preserving the intended exercise.

Scalionix Docs

Keyboard Shortcuts

Navigate the documentation without leaving the keyboard.
Navigation
Previous subject
←
Next subject
→
Previous subsection
Alt + ↑
Next subsection
Alt + ↓
Interface
Documentation Home
Ctrl + Enter
Search
Alt + Q
Open shortcuts
?
Close dialog
Esc
Scalionix Docs

Search Documentation