Breaking

Post Top Ad

Your Ad Spot

Monday, 26 October 2020

e-maze-in Problem HackerEarth Solution in Java || Basics Programming || Basics of Input/Output problems|| Practise Problems

e-maze-in Problem HackerEarth Solution

 Problem Statement:

Ankit is in Maze....  in Respective direction.

e-maze problem hackerank solution
Emaze Problem  




Solution Code in java:

import java.io.BufferedReader;
import java.io.InputStreamReader;
class TestEmaze {
    public static void main(String args[] ) throws Exception {
       
        BufferedReader brnew BufferedReader(new InputStreamReader(System.in));
        String sbr.readLine();
        int x=0, y=0;
        if(s.length()>=1 && s.length()<=200){
        for(int i=0;i<s.length();i++){
            char cs.charAt(i);
            switch (c)
            {
                case 'L': x=x-1;
                break;
                case 'R': x=x+1;
                break;
                case 'U': y=y+1;
                break;
                case 'D': y=y-1;
                break;
            
            }
        }
        System.out.println(x + " " +y);
        }

    }
}


Hello Everyone, on this website you will get programming tutorials and projects so please follow us on our social media and subscribe to your feed. For any query, doubts please comment below. You can also react to the post using emoji.

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages