ts working fine there is only single duplicate character present but failing when more than one duplicate charater is present.
Do not wait to strike till the iron is hot; but make it hot by striking....
Do not wait to strike till the iron is hot; but make it hot by striking....
Do not wait to strike till the iron is hot; but make it hot by striking....
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
deepak carter wrote:I dont want to use map as i dont want to complicate thing.(might become easier with using Map but don't want that).
Dennis Deems wrote:There really is no simpler solution than using a Map.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:
Dennis Deems wrote:There really is no simpler solution than using a Map.
There is the possibility of using an int[] where you use chars for the indexes. This does require an int[] of length 65536 though, unless the text is limited to only ASCII, in which case the array only needs 128 elements.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
I am a man of mystery. Mostly because of this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|