How to resolve the algorithm Compare length of two strings step by step in the Phix programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Compare length of two strings step by step in the Phix programming language

Table of Contents

Problem Statement

Given two strings of different length, determine which string is longer or shorter. Print both strings and their length, one on each line. Print the longer one first. Measure the length of your string in terms of bytes or characters, as appropriate for your language. If your language doesn't have an operator for measuring the length of a string, note it. Given more than two strings: list = ["abcd","123456789","abcdef","1234567"] Show the strings in descending length order.

Let's start with the solution: