Statistics

Problem Statement for "StringSort"

Problem Statement

PROBLEM STATEMENT

You are given a String consisting of lower-case letters.  Sort the characters
within that String in ascending alphabetical order, and return the resulting
String.  For example, if you are given the String "dbcba", you would re-arrange
the letters to form the String "abbcd".

DEFINITION

Class: StringSort
Parameters: String
Returns: String
Method signature (be sure your method is public): String sort(String str);

INPUT CONSTRAINTS

TopCoder will verify that all input constraints are met.
- str will contain between 0 and 50 characters, inclusive.
- str will contain only lower-case letters (a-z).

EXAMPLES:

str: "pickle"
Returns: "ceiklp"

str: "abhor"
Returns: "abhor"

str: "sortthisstring"
Returns: "ghiinorrsssttt"

str: "tesla"
Returns: "aelst"

str: ""
Returns: ""

Definition

Class:
StringSort
Method:
sort
Parameters:
String
Returns:
String
Method signature:
String sort(String param0)
(be sure your method is public)

Constraints

    Examples


      This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
      This problem was used for: