Joined
Last Seen
0 Reputation Points
0% Quality Score
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
0 Endorsements
Ranked #107.55K
1 Posted Topic
Re: import java.util.*; public class RepeatedExample { public static void main(String[] args) { HashMap<Character, Integer> map = new HashMap<Character, Integer>(); String theString = "aaba"; for (int i = 0; i < theString.length(); i++) { if ( map.containsKey(theString.charAt(i))) { map.put (theString.charAt(i), map.get(theString.charAt(i)) + 1 ); } else { map.put (theString.charAt(i), 1); } … |
The End.