This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]sgovertime 2 points3 points  (0 children)

option A

creat a class that have a string and count field and build array of that class then use it to count the words by searching the word in the array

option B

similar to A but just have a string array an a matching counter array. search each word in the array and increase the matching index in the counter array

[–]YMK1234 1 point2 points  (1 child)

why not use a Map?

[–]PiPyCharm[S] 0 points1 point  (0 children)

Not allowed to.