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


Sam and Mansi volunteered for the Coldplay concert. Chris Martin loved the crowd which is why he<br>gave Sam 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 Sam 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>Sam 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 Python Cod.<br>Input:<br>2<br>UD<br>Output:<br>3<br>

Extracted text: Sam and Mansi volunteered for the Coldplay concert. Chris Martin loved the crowd which is why he gave Sam 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 Sam 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. Sam 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 Python Cod. Input: 2 UD Output: 3

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here