We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functiontoys($w){// Write your code heresort($w);$count_w=count($w);$w_first=$w[0];$counter=1;for($i=0;$i<$count_w;$i++){if($w[$i]>(4+$w_first)){$counter++;$w_first=$w[$i];}}return$counter;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Priyanka and Toys
You are viewing a single comment's thread. Return to all comments →
Here is my PHP solution: