We're not going to do your homework for you, but some things to consider: - maps are good at associating values with names - there's a strings.ToLower() <https://golang.org/pkg/strings/?m=all#ToLower> function you will find useful - sort.Ints <https://golang.org/pkg/sort/#Ints> sorts ints in ascending order - if s is a string, s[0] is a rune - if r is a rune, string(r) is a 1 character string
These are bits of Go that you will find helpful in solving your assignment. On Sat, Feb 27, 2021 at 7:02 PM Vignesh Kumar <vinesh1...@gmail.com> wrote: > Hello all, > > Thanks in advance. Please help me to finish this assignments. > > Write a program which will accept a string. This program should output all > the characters and number of their occurrences, in order of their > occurrences. So that, character appearing most number of times should be > printed first and characters appearing least number of times (i.e. 1 time) > should appear at the last. Capital and small characters should be > considered as same. Only spaces in the input string should not be counted. > > Example: Input string is "Hello there", it should output: e: 3, h: 2, l: > 2, o:1, i: 1, t : 1, r: 1 * > > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/b608f1a5-d833-4bf1-b954-61598e30f808n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/b608f1a5-d833-4bf1-b954-61598e30f808n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29Ls0wT5uSVwY4ActAZ8exRGJH0W3Bw2vR85bdjsUnuvckA%40mail.gmail.com.