NPTEL Programming Data Structures And Algorithms Using Python | NPTEL Week 8 Programming Assignment | NPTEL Assignment Solutions

NPTEL Programming, Data Structures And Algorithms Using Python Week 8 Programming Assignment | NPTEL Swayam Assignment Answers


nptel programming data structures and algorithms using python


Join Us On Telegram

👇👇👇👇👇👇👇

telegram

Join Us On Youtube

👇👇👇👇👇👇👇

youtube




Nptel Week 8 Programming Assignment Answers:


Q.1: For this assignment, you have to write a complete Python program


for this assignment, you have to write a complete python program


Domino Solitaire

(Indian National Olympiad in Informatics, 2008)

In Domino Solitaire, you have a grid with two rows and many columns. Each square in the grid contains an integer. You are given a supply of rectangular 2 × 1 tiles, each of which exactly covers two adjacent squares of the grid. You have to place tiles to cover all the squares in the grid such that each tile covers two squares and no pair of tiles overlap.

The score for a tile is the difference between the bigger and the smaller number that are covered by the tile. The aim of the game is to maximize the sum of the scores of all the tiles.

Here is an example of a grid, along with two different tilings and their scores.


in Domino Solitaire, you have a grid with two rows and many columns
for all inputs


Code:






If you are facing any queries regarding this assignment solutions, then please drop comment in comment section.

Post a Comment

0 Comments