hackerrank 2d array: day 11 of 30 days of code - Deepstash

hackerrank 2d array: day 11 of 30 days of code

#!/bin/python3

import math

import os

import random

import re

import sys

if __name__ == '__main__':

    arr = []

    for _ in range(6):

        arr.append(list(map(int, input().rstrip().split())))

    sum = 0

    tarr = []

    

    for l in range(0,4):

        for k in range(0,4):

            for i in range(l,l+3):

                for j in range(k,k+3):

                    if i == l+1 and ( j == k or j == k+2):

                        continue

                    else:

                        sum += arr[i][j]

            tarr.append(sum)

            sum = 0

    

    print(max(tarr))

1

10 reads

CURATED FROM

IDEAS CURATED BY

anivana

Improve the process

I will be collecting artful code on python here, it's in a nascent stage but hope it becomes awesome with time

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates