Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Kattis - Prva - C Language I need an expert to work out the code for the problem described below for me please. Thanks! Prva

Kattis - Prva - C Language

I need an expert to work out the code for the problem described below for me please. Thanks!

image text in transcribed

Prva Little Ivica solves crossword puzzles every day. In case you haven't seen one, a crossword puzzle starts on a grid of Rx C squares, each of which is either empty or blocked. The player's task is to write words in consecutive empty squares vertically (top down) o r horizontally (left to right). Ivica's sister has a strange habit of looking at crosswords Ivica has finished solving, and finding the lexicographically smallest word in it. She only considers words at least 2 characters long. Write a program that, given a crossword puzzle, finds that word. Input The first line contains two integers R and C (2-R, C-20), the number of rows and columns in the crosswords. Each of the following R lines contains a string of C characters. Each of those characters is either a lowercase letter of the English alphabet, or the character , representing a blocked square The input will be such that a solution will always exist. Output Output the lexicographically smallest word in the crossword Sample Input 1 Sample Output 1 kala luka kula i#a# Sample Input 2 Sample Output 2 as luka o#a# kula i#as Sample Input 3 Sample Output 3 abb adaca da##b abb#6 abbac

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions