public/subjects/printcomb
lee 8ffc65ce3d chore(exam): remove all folders that contained "-exam" suffix & add the main.go to exercises that needed it 2024-01-04 09:36:37 +00:00
..
README.md Update README.md 2021-07-02 17:44:12 +01:00
main.go chore(exam): remove all folders that contained "-exam" suffix & add the main.go to exercises that needed it 2024-01-04 09:36:37 +00:00

README.md

printcomb

Instructions

Write a function that prints, in ascending order and on a single line: all unique combinations of three different digits so that, the first digit is lower than the second, and the second is lower than the third.

These combinations are separated by a comma and a space.

Expected function

func PrintComb() {

}

Usage

Here is a possible program to test your function :

package main

import "piscine"

func main() {
	piscine.PrintComb()
}

This is the incomplete output :

$ go run . | cat -e
012, 013, 014, 015, 016, 017, 018, 019, 023, ..., 689, 789$
$
  • 000 or 999 are not valid combinations because the digits are not different.

  • 987 should not be shown because the first digit is not less than the second.

Notions