Combinatorial Exploration

Published by Mubashir Hassan in

Given a known number of unique items, how many ways could we arrange them in a row?

Create a function that takes an integer n and returns the number of digits of the number of possible permutations for n unique items. For instance, 5 unique items could be arranged in 120 unique ways. 120 has 3 digits, hence the integer 3 is returned.

Examples

noPermsDigits(0) ➞ 1

noPermsDigits(1) ➞ 1

noPermsDigits(5) ➞ 3

noPermsDigits(8) ➞ 5

Notes

This challenge requires some understanding of combinatorics.

Watch a quick demo on how Edabit works.