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

 

amjadm@miamioh.edu assignment3 > putTogether
prev  |  next  |  chance

Given a string, find the same characters, put them together and return a new string having the same characters together. e.g. if the given string is "ababcfdccab", the new string should look like "aaabbcccfd". You can assume all the characters are in lowercase and there will be no space in the given string. And the order of characters matters.


putTogether("") → ""
putTogether("acda") → "aacd"
putTogether("1w2g1dw2md2") → "11ww222gddm"

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

public String putTogether(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: 190 Post-solution available

Copyright Nick Parlante 2017 - privacy