codeeval.com rightmost char commit. added test cases for later optimization.