The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to find duplicate characters in String

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to find duplicate characters in String Posted: Mar 6, 2014 9:51 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to find duplicate characters in String
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
This weeks programming exercise is to write a program to find repeated characters in a String. For example if given input to your program is "Java", it should print all duplicates characters, i.e. characters appear more than once in String and their count e.g. a = 2, because character 'a' has appeared twice in String "Java". This is also a very popular coding question on various level of Java interviews and written test, where you need to write code. On difficulty level this question is at par with prime numbers or Fibonacci series. I personally like this exercise because it gives beginners an opportunity to familiar with concept of Map data-structure, which allows you store mappings in form of key and value. Since Map is heavily used in any enterprise Java application, good knowledge of this data structure is highly desirable among any level of Java programmers. By the way there are couple of variant of this program, sometime interviewer will ask you to read a file and print all duplicate characters and their count, core logic will remain same, all you need to do is demonstrate how much you know about File IO in Java e.g. streaming file if its very large rather than reading whole file in memory.
Read more »

Read: How to find duplicate characters in String

Topic: Using Scala traits as modules, or the “Thin Cake” Pattern Previous Topic   Next Topic Topic: The regex that broke a server

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use