注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
90分钟,3道coding。有一道很简单,忘记拍了。
1. Lucy loves to play the Hop, Skip and Jump game. Given an N*M matrix and starting from cell (1,1), her challenge is to hop in an anti-clockwise direction and skip alternate cells. The goal is to find out the last cell she would hop onto.
Write an algorithm to find the last cell Lucy would hop onto after moving anti-clockwise and skipping alternate cells.
Input
The first line of input consists of two integers- matrix_ row and matrix_col, representing the number of rows (N) and the number of columns (M) in the matriof "Yes" if the word is present in the grid or "No" if the word is not present in the grid.
Note
All the inputs are case-sensitive, meaning "a" and "A" are considered as two different characters.
Example
Input:
3 3
C A T
I D O
N O M
4
CAT TOM ADO MOM
Output:
Yes Yes Yes No |