Ad
Code
Diff
  • package kata
    
    func Multiple3And5(number int) int {
        // Code goes here
    }
    • package kata
    • func Multiple3And5(number int) int {
    • // Code goes here
    • }

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in.

Note: If the number is a multiple of both 3 and 5, only count it once.

package kata

func Multiple3And5(number int) int {

}

Count the number of occurrences of each character and return it as a list of tuples in order of appearance. For empty output return an empty list.

Example:

'''
OrderedCount("abracadabra") == []Tuple{Tuple{'a', 5}, Tuple{'b', 2}, Tuple{'r', 2}, Tuple{'c', 1}, Tuple{'d', 1}}

// Where
type Tuple struct {
Char rune
Count int
}
'''

package orderedcount

// Use the preloaded Tuple struct as return type
// type Tuple struct {
//	Char  rune
//	Count int
// }

func OrderedCount(text string) []Tuple {
 // to implement
}