TopcoderArchive
Archive22 Aug 2006
TCCC06 Qual 2

ProseFlip

Problem statement, definition, constraints, and public examples.

Problem Statement

Each element of text is a line of prose from some passage. You will return a String[] that is read downward as opposed to left-to-right. That is, the first element of text will correspond to the first "column" of the returned String[], and so forth.

Definition

Class:
ProseFlip
Method:
getFlip
Parameters:
String[]
Returns:
String[]
Method signature:
String[] getFlip(String[] text)
(be sure your method is public)

Constraints

  • text will contain between 1 and 50 elements, inclusive.
  • Each element of text will contain between 1 and 50 characters, inclusive.
  • Each element of text will contain the same number of characters.
  • Each character in text will be an uppercase letter ('A'-'Z').

Examples

  1. {
    "AAA",
    "BBB",
    "CCC"
    }
    Returns: {"ABC", "ABC", "ABC" }
    Rows of the input become columns of the return value.
  2. {"AAAAAAAAAAAAA"}
    Returns: {"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A" }
    One long row.
  3. {
    "A",
    "A",
    "A",
    "A",
    "A"
    }
    Returns: {"AAAAA" }
    One long column.
Back to all problems