<prompt> Kubuni algorithm kupata mrefu neno katika kamba.  <response>: Here is one way to design an algorithm to find the longest word in a string:1. Start by initializing two variables: longest_word and max_length. Set longest_word to an empty string and max_length to 0.2. Split the input string into a list of words using the split method. This method splits a string into a list of words based on a separator such as a space. 3. Iterate through the list of words using a for loop.4. For each word in the list, find its length using the len method.5. Compare the length of the current word with the max_length variable. If it is greater, update the max_length variable with the length of the current word, and update the longest_word variable with the current word.6. Once the loop is done, the longest_word variable will contain the longest word in the string.7. Return the longest_word.Here is the corresponding Python code to implement the algorithm:pythondef find_longest_wordinput_string: longest_word max_length 0 words input_string.split for word in words: word_length lenword if word_length max_length: max_length word_length longest_word word return longest_word 