id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

abraskin@mbusd.org 2019_units1-4_practice > jinxOrder
prev  |  next  |  chance

Given a String, return it unchanged if the first character comes before the last lexicographically, backwards if the last comes before the first, and simply "jinx" if the letters are the same.


Return "error" if the String is less than two characters.

jinxOrder("ABCDE") → "ABCDE"
jinxOrder("EDCBA") → "ABCDE"
jinxOrder("BABABA") → "ABABAB"

...Save, Compile, Run (ctrl-enter)

public String jinxOrder(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 200

Copyright Nick Parlante 2017 - privacy