Question: code javascript: Find a string of a given length containing as many different lower - case letters as possible, in which each letter occurs an
code javascript: Find a string of a given length containing as many different lowercase letters as possible, in which each letter occurs an equal number of times.
Task description
Write a function solution that, given an integer N returns a string of length N containing as many different lowercase letters az as possible, in which each letter occurs an equal number of times.
Examples:
Given N the function may return "fig", "pea", "nut", etc. Each of these strings contains three different letters with the same number of occurrences.
Given N the function may return "mango", "grape", "melon", etc.
Given N the function may return "aabbcc...ooeach letter from a to o occurs twice The string contains different letters.
Write an efficient algorithm for the following assumptions:
N is an integer within the range
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
