SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

Added Soln For the Prob. A Beautiful Matrix #358

Closed Harshit09-lang closed 2 years ago

Harshit09-lang commented 2 years ago

Issue Id you have worked upon -

ISSUE ID: #323 Added the solution for the problem "A Beautiful Matrix". Problem Number: 263A

Question Statement: You've got a 5 × 5 matrix, consisting of 24 zeroes and a single number one. Let's index the matrix rows by numbers from 1 to 5 from top to bottom, let's index the matrix columns by numbers from 1 to 5 from left to right. In one move, you are allowed to apply one of the two following transformations to the matrix:

Swap two neighboring matrix rows, that is, rows with indexes i and i + 1 for some integer I (1 ≤ i < 5). Swap two neighboring matrix columns, that is, columns with indexes j and j + 1 for some integer j (1 ≤ j < 5). You think that a matrix looks beautiful if the single number one of the matrix is located in its middle (in the cell that is at the intersection of the third row and the third column). Count the minimum number of moves needed to make the matrix beautiful.

Checklist:

All the conditions should be fulfilled for considering your code for merging -

Here is the custom Test Case 1 Test Case 1

Here is the custom Test Case 2 Test Case 2

Please check and Merge this PR.

SarthakKeshari commented 2 years ago

@Harshit09-lang, Kindly create an issue first and then PR. And follow the PR template and contribution guidelines. I am not closing this PR since this was your first time. You may refer CONTRIBUTING.md and create an issue.

Harshit09-lang commented 2 years ago

I have already created an issue. CodeForces Problem 263A #323 I have already followed all the guidelines that you mentioned.

SarthakKeshari commented 2 years ago

@Harshit09-lang, Kindly add #323 in the issue id section of PR template.

Harshit09-lang commented 2 years ago

Issue Number: #323 Sir, I have committed the changes that I was told about. Please merge this PR.

SarthakKeshari commented 2 years ago

@Harshit09-lang, Kindly follow the PR template, In issue worked upon kindly mention your issue id and add screen shots as was mentioned in PR template.

Harshit09-lang commented 2 years ago

Sir, I have added the Issue ID i.e. #323, and have also added the Screen Shots of the code running on the custom Test Cases. Please Review it.