How to resolve the algorithm Isograms and heterograms step by step in the Phix programming language
How to resolve the algorithm Isograms and heterograms step by step in the Phix programming language
Table of Contents
Problem Statement
For the purposes of this task, an isogram means a string where each character present is used the same number of times and an n-isogram means an isogram where each character present is used exactly n times. A heterogram means a string in which no character occurs more than once. It follows that a heterogram is the same thing as a 1-isogram.
caucasus is a 2-isogram because the letters c, a, u and s all occur twice. atmospheric is a heterogram because all its letters are used once only.
Using unixdict.txt and ignoring capitalization:
-
Find and display here all words which are n-isograms where n > 1. Present the results as a single list but sorted as follows: a. By decreasing order of n; b. Then by decreasing order of word length; c. Then by ascending lexicographic order.
-
Secondly, find and display here all words which are heterograms and have more than 10 characters. Again present the results as a single list but sorted as per b. and c. above.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Isograms and heterograms step by step in the Phix programming language
Source code in the phix programming language
You may also check:How to resolve the algorithm Draw a pixel step by step in the Icon and Unicon programming language
You may also check:How to resolve the algorithm Additive primes step by step in the Free Pascal programming language
You may also check:How to resolve the algorithm A+B step by step in the Groovy programming language
You may also check:How to resolve the algorithm Chaos game step by step in the C programming language
You may also check:How to resolve the algorithm Sorting algorithms/Insertion sort step by step in the Phix programming language