Krushi and Mansi volunteered for the Coldplay concert. Chris Martin loved the crowd which is why he gave Krushi and Mansi an endless number of Tshirts to give to his fans. They both jumped into the...


Krushi and Mansi volunteered for the Coldplay concert. Chris Martin loved the crowd which is why<br>he gave Krushi and Mansi an endless number of Tshirts to give to his fans.<br>They both jumped into the crowd. Chris Martin points to N number of followers one at a time, first<br>at Krushi and then at Mansi.<br>Imagine endless fans arranged with a 2D infinte grid, with each follower standing at each step in an<br>orderly fashion. Chris gives them directions in the form of an S unit and they follow blindly. As a<br>result, few fans appear with more than one T-shirt.<br>Krushi and Mansi start at the same place (bring two T-shirts to the same starting fan), and take turns<br>based on orders from Chris, who gives them orders as follows:<br>U - Move up the stairs<br>D - Go Down one step<br>L- Go Left one step<br>R - Go Right one step<br>Given the S-letter unit of the instructions given to Chris. Which brings out the number of lucky fans<br>who have received at least one T-shirt Using C++ language.<br>Input:<br>4<br>ULDR<br>Output:<br>3<br>

Extracted text: Krushi and Mansi volunteered for the Coldplay concert. Chris Martin loved the crowd which is why he gave Krushi and Mansi an endless number of Tshirts to give to his fans. They both jumped into the crowd. Chris Martin points to N number of followers one at a time, first at Krushi and then at Mansi. Imagine endless fans arranged with a 2D infinte grid, with each follower standing at each step in an orderly fashion. Chris gives them directions in the form of an S unit and they follow blindly. As a result, few fans appear with more than one T-shirt. Krushi and Mansi start at the same place (bring two T-shirts to the same starting fan), and take turns based on orders from Chris, who gives them orders as follows: U - Move up the stairs D - Go Down one step L- Go Left one step R - Go Right one step Given the S-letter unit of the instructions given to Chris. Which brings out the number of lucky fans who have received at least one T-shirt Using C++ language. Input: 4 ULDR Output: 3

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here