This is my homework which is due tomorrow and I have been trying to do it for the past 5 hours, but I can't figure it out. I understand what I have to do, but I just don't know where to start. If you could help me to just get started or to give some advice it would be great. Can i just have the answer I cant figure it out iv tried everything
It has to Return an array of int, of size 27, consisting of character counts from the String s.
- The count of the number of 'a' or 'A' characters must be in position 0 of the array,
- the count of the number of 'b' or 'B' characters must be in position 1 of the array,
- the count of the number of 'z' or 'Z' characters must be in position 25 of the array, and
- the count of all other characters must be in position 26 of the array.
for example
- if s is "", then all entries in the array must be 0.
- if s is "a", then all entries in the array must be 0 except for entry 0, which must be 1.
- if s is "Baaa!", then all entries in the array must be 0 except for:
- entry 0, which must be 3,
- entry 1, which must be 1, and
- entry 26, which must be 1.
The only methods you may call on the String s are charAt(int) and length().
Thanks iv read everything you guys have said and its helped me alot in understanding the problem and what i need to do. Im still stuck however but im slowly getting this. Thanks again!