Question
PHP Write a function on PHP countdownFront($str, $num) that returns a string made of the first $num characters of the string followed by the first
PHP
Write a function on PHP countdownFront($str, $num) that returns a string made of the first $num characters of the string followed by the first $num-1 characters, followed by the first $num-2 characters, and so on. For example, countdownFront("Pancakes", 5) would return the string "PancaPancPanPaP".
Write a function on PHP longestRun($str) that takes a string as a parameter and returns the length of the longest sequence of the same character in the string. For example, longestRun("abc") should return 1, where longestRun("abbcddde") would return 3 because there are 3 ds in a row.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started