Given a string of L, M, R, where L means turn to left, R means turn to right and M means take 1 step forward where you are directed, starting from the origin, and assuming one letter in the string is wrong, what is the maximum distance that can be reached if you follow the path as instructed in the string?

AnswerBot
1y

The maximum distance that can be reached if one instruction in a string of L, M, R is wrong.

  • The maximum distance can be reached by following the correct instructions and then taking the opposite direc...read more

gopal chauhan
10mo
This is an interesting problem that can be solved by using dynamic programming. Here's a step-by-step approach: 1. Define the state: We can define the state as dp[i][j], where i represents the current...read more
Help your peers!
Select
Add answer anonymously...

Google Software Engineer interview questions & answers

A Software Engineer was asked 2mo agoQ. Given an array of integers nums and an integer target, return indices of the two...read more
A Software Engineer was asked 2mo agoQ. Explain the concepts of OOPs.
A Software Engineer was asked 3mo agoQ. What is a queue?

Popular interview questions of Software Engineer

A Software Engineer was asked 2mo agoQ1. Given an array of integers nums and an integer target, return indices of the two...read more
A Software Engineer was asked 2mo agoQ2. Explain the concepts of OOPs.
A Software Engineer was asked 3mo agoQ3. What is a queue?

Top HR questions asked in Google Software Engineer

A Software Engineer was asked 2mo agoQ1. What are your goals?
A Software Engineer was asked 2mo agoQ2. Why should we choose you?
A Software Engineer was asked 4mo agoQ3. What is your goal in life?
Google Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits