#include "Lib.h"

//-----------------------------------------------------------------
//                        LongestString
//                        -------------
//
// General      :  The function check who the longest string in list 
//
// Parameters   :  **manager - pointer linear Linked List(IN)
//
// Return Value : The index of longest string
//
//-------------------------------------------------------------------
// Programer    : Cohen Idan
// Student No.  : 211675038
// Date         : 12.12.2019
//-------------------------------------------------------------------
LLL * LongestString(LLL ** manager)
{
    LLL * runner = *manager;
    LLL * result = runner;
    unsigned int max = ZERO;
    unsigned int str_len = ZERO;
    while (runner != NULL)
    {
        str_len = StringLenght((*runner).value.pointer);
        if (str_len > max)
        {
            max = str_len;
            result = runner;
        }
        runner = (*runner).next;
    }
    
    return (result);
}

void main(void)
{

}