cswork / OAOpen practice workspace

Valkyrie TradingOA #3

Max Element Indices After Array Rotations

Estimated EasyStatement and editorial — judging is being prepared

Topics (AI-labelled)In-place ArraysStrings

Parse a string of form "data;rotations" into two arrays. For each number k in rotations, perform k left rotations on a fresh copy of the original data array, then output the index of the max element. Output is a space-separated list of indices.

Left rotation: first element moves to the end; everything else shifts left by 1. After 1 rotation on (10, 20, 50) → (20, 50, 10).

Examples:

  • "10 20 30 40 50;1 2 3" → "3 2 1"
  • "99 1 2 3 4;1 2 5" → "4 3 0"

Editorial

Loading solution…