blob: 77348500cc80025af4f3bd777939a4fc031d5a75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
Code Test
A customer wishes to create a word count program. However unlike a
traditional word count they
wish to ignore words which are partial matches of longer words For
example using the following
text:
A mate material may maybe right maybe
A is discarded as it is contained in mate, material, may and maybe.
A mate material may maybe right maybe
Mate is discarded as it is contained in material.
A mate material may maybe right maybe
May is discarded as it is contained in maybe
A mate material may maybe right maybe
Write a Java program which takes an input file and outputs the word
count, for example based on
the previous example text the output would be:
Material: 1
Maybe: 2
Right: 1
The output should be sorted by longest word in descending order.
Ensure that your code is written to commercial standards.
|