Trace Path | Hindi | GFG POTD | C++ | Java | Code Kar Lo



Trace Path | Hindi | GFG POTD | C++ | Java | Code Kar Lo

Trace Path | Hindi | GFG POTD | C++ | Java | Code Kar Lo

There is a rectangular path for a Train to travel consisting of n rows and m columns. The train will start from one of the grid’s cells and it will be given a command in the form of string s consisting of characters L, R, D, U. Find if it is possible to travel the train inside the grid only.
Note:
If the train is at position (i,j)
on taking ‘L’ it goes to (i,j-1),
on taking ‘R’ it goes to (i,j+1),
on taking ‘D’ it goes to (i-1,j),
on taking ‘U’ it goes to (i+1,j).

0:00 Introduction
0:15 Problem Statement
1:38 White Board Explanation
10:00 Complexity Analysis
10:15 C++ Code
13:20 Java Code

gfg potd
gfg potd today
gfg problem of the day

My DSA Journey:- https://youtu.be/quZBBv12mCQ

How to Earn By GFG Articles:- https://youtu.be/XjvEgkd49Gk

Problem Link:-https://practice.geeksforgeeks.org/problems/trace-path3840/1

Code Link:-https://github.com/ShubhamKashyap138/Data-Structure/blob/main/Trace%20Path

Playlist Link:-https://youtube.com/playlist?list=PLq3GlRZI14Hui2ILGsfF1Uf2RnbNu9wT3

Linkedin:- https://www.linkedin.com/in/shubham-kashyap-65a29a218/

Instagram:- https://instagram.com/im_shubham_kashyap?igshid=YmMyMTA2M2Y=

My GFG Profile:- https://auth.geeksforgeeks.org/user/shubhamrajput6156/practice

#dsa #datastructures #algorithm #gfg #potd #coding #array #strings #tree #binarysearchtree #codekarlo #dynamicprogramming

Comments are closed.