Serpentine
SRM 139 · 2003-03-18 · by dgoodman
Problem Statement
Create a class Serpentine that contains a method column that is given a
It should return the column as a
Constraints
- s has length between 1 and 50 inclusive
- s contains only uppercase letters 'A'-'Z'
- width is between 1 and 50 inclusive
- index is between 0 and width-1 inclusive
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" 8 0 Returns: "APQ"
ABCDEFGH PONMLKJI QRSTUVWX ZY index 0 refers to the first column. Note that the returned String must not contain a trailing space.
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" 8 6 Returns: "GJWZ"
"ABCDEFG" 10 8 Returns: ""
"THISISATEST" 4 2 Returns: "IST"
"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX" 1 0 Returns: "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX"
Submissions are judged against all 28 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class Serpentine with a public method string column(string s, int width, int index) · 28 test cases · 2 s / 256 MB per case