Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Samples to use : !) 17 7 VAAAAAPAAEAFRLDAR AAAYPBAKAWPKAJEAA AFAAAUTFENWAQALPC YYXTHALXSCCMIAAGA AAXAAZRANZAJALQAA ZAAAXGJIOAAPAALAX JAAAAIAAAAATAAADA 2) 15 15 PAYAAHARACAAAAA ASHAAOAEBFYALAS YAAOVBAAAEJBAKQ AAEAXAAAQAQEAAT AEJZLMUAXHIAAYA AFAEAAAFKAATPKA AAKAAAUAATAAAPU AAAAAAAXAKAAAAQ
Samples to use :
!) 17 7 VAAAAAPAAEAFRLDAR AAAYPBAKAWPKAJEAA AFAAAUTFENWAQALPC YYXTHALXSCCMIAAGA AAXAAZRANZAJALQAA ZAAAXGJIOAAPAALAX JAAAAIAAAAATAAADA
2) 15 15 PAYAAHARACAAAAA ASHAAOAEBFYALAS YAAOVBAAAEJBAKQ AAEAXAAAQAQEAAT AEJZLMUAXHIAAYA AFAEAAAFKAATPKA AAKAAAUAATAAAPU AAAAAAAXAKAAAAQ VBAJHPAANWAAAAT AAAWAAZOAIAOHOE AAAJADMAIZANAEA MAFWUAAKBPAALGB AHKAITAAXFAGAAA DIAGWZARRAANAUA SAAXHAHAFJAYZAA
3) 4 5 AUAA BAAA TKTA AAXA DASX
use python with pycharm
CS 1120 Spring 2020 LA3 Longest 'A' Path CS 1120 Spring 2020 LA3 Longest 'A' Path Lab Assignment 3 Longest 'A' Path Your program should read the data for the map from a text file (multiple .txt input files will be provided), find the longest A path, and output the length of that path. In the input file, the first line contains 2 integers m and n. These integers represent the number of columns m and the number of rows n of the map. Starting from the second line of the text file, the map is represented as n strings with m characters each. Due Date (a two-week LA) Wednesday Labs 2/26/20 @ 11:59pm Thursday Lab 2/27/20 @ 11:59pm Example Input: 17 7 VAAAAAPAAEAFRLDAR JEAA AFAAAUTFENWAQALPC YYXTHALXSCCMIAAGA AAXAAZRANZAJALQAA ZAAAXGJIOAAPAALAX JAAAAIAAAAATAAADA Objectives Manipulating two-dimensional lists Using recursion to solve a problem Example output: Map dimensions: Number of columns: 17 Number of rows: 7 Length of the longest "A" path: 10 Problem Specification Write a Python application to find the longest 'A' path on a map of capital (uppercase) letters. The map is represented as a matrix (2-dimensional list) of capital letters. Starting from any point, you can go left, right, up and down (but not diagonally). A path is defined as the unbroken sequence of letters that only covers the spots with the letter A. The length of the A path is defined as the number of 'A's on the path. Your program needs to find the longest A path on the map. In the following example, the characters in the longest A path are highlighted and the length of the longest path is 7. Note that you cannot move backwards over a character 'A' that has already been counted. In the example below, start from the 'A' in the 4th row, 4th column, move upwards and end at the 'A' on the second row, second column. Example input: 15 15 PAYAAHARACAAAAA ASHAADAEBFYALAS YAAOVBAAAEJBAKQ AAEAXAAAQAQEAAT AEJZLMUAXHIAAYA AFAEAAAFKAATPKA AAKAAALAATAAAPU AAAAAAAXAKAAAAQ VBAJHPAANWAAAAT AAAWAAZOAIAOHOE AAAJADMAIZANAEA MAFWUAAKBPAALGB AHKAITAAXFAGAAA DIAGWZARRAANAUA SAAXHAHAF JAYZAA A U AA B A A A IKT Example output: Map dimensions: Number of columns: 15 Number of rows: 15 D Length of the longest "A" path: 20 A A X AStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started