Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: 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.

Question:

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. write python code.

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 matrix, respectively. The next M lines consist of N space-separated integers representing the elements in each cell of the matrix.

Output: Print an integer representing the last cell Lucy would hop onto after following the given instructions.

Example:

input:

3 4
9 8 7 6
5 4 3 2
1 10 11 12
output:
4
can u pls provide answer in python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago