C programming answer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C programming answer

There is a row of vibrant stones. Each stone has one of three colours: red, has on green, or blue. A string named s is supplied to you. The hue of the i-th stone is represented by the i-th (1-based) character of the letter s. The colour of the associated stone depends on whether the character is "R." "G," or "B." Squirrel Liss is initially positioned on the first stone. One or more times, you follow directions. Squirrel Liss is initially positioned on the first stone. One or more times, you follow directions. There are three different types of instructions: "RED," "GREEN," or "BLUE." If Liss is standing on a stone whose colour is c after receiving instruction c, she will advance one stone; otherwise, she won't. A string named t is supplied to you. The length of t is equal to the number of instructions, and the i-th character in t corresponds to the i-th instruction. After following all the instructions, determine Liss's final position (the number of the stone she will ultimately stand on), and publish its

11th Apr 2023, 10:18 AM
Mathi Subbiah Pandian
Mathi Subbiah Pandian - avatar
1 Answer
+ 9
Mathi Subbiah Pandian , this a really nice challenge! > what is your issue or question? > please also link your code try here.
11th Apr 2023, 10:32 AM
Lothar
Lothar - avatar