Reach Ks (Keteki)
All submissions for this problem are available.Given a 2D grid, represented by a string array, a character in a row is occupied and cannot be entered if its a '#'. And is empty and can be entered if its a '.'. If a character is 'X', then you are currently present there. There will be some characters which are 'K'. Print "Yes", if its possible to reach all 'K's, else print "No".
(All quotes for clarity and the characters in input are case sensitive).
1<=number of strings in the array<=7
1<=length of each string<=7
Each character in the string will be either '#', '.', 'X' or 'K'.
Number of 'X'=1
Starts with two integers N and M, separated by a single space on a new line, N representing the number of rows and M representing the number of columns in the grid. It will be followed by N rows of strings each of length M.
Print "Yes" or "No", depending on the situation.
Explanation: Since there are no 'K's, all can be visited.
Explanation: No 'K's can be reached.
Explanation: All 'K's can be visited.
|Tags||chandubaba, chandubaba, keteki, qm172019|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions