PHP code example of josantonius / algorithm

1. Go to this page and download the library: Download josantonius/algorithm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

josantonius / algorithm example snippets


Algorithm::lookAndSay($lastSequence, $maxLines);



use Josantonius\Algorithm\Algorithm;



use Josantonius\Algorithm\Algorithm;

echo Algorithm::lookAndSay();

/*
1
11
21
1211
111221
312211
13112221
1113213211
31131211131221
13211311123113112211
11131221133112132113212221
3113112221232112111312211312113211
1321132132111213122112311311222113111221131221
11131221131211131231121113112221121321132132211331222113112211
311311222113111231131112132112311321322112111312211312111322212311322113212221
*/

echo Algorithm::lookAndSay(22, 5);

/*
22
22
22
22
22
*/
console
wget https://raw.githubusercontent.com/josantonius/php-algorithm/master/src/Algorithm.php