For example, if I start with the string “dcab” I want a function that takes that string and produces the string “abcd” from it. Likewise “cat” should produce “act”. I’m trying to think of an efficient way to do this. Thanks for any help.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Arrays.sort(char[] a)Not too sure about efficiency, but this is probably the simplest implementation.