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

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

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

MORE IDEAS ON THIS

fb logo with python turtle, from turtle import *

speed(10)

color("#0270d6")

Screen().bgcolor("yellow")

penup()

goto(0, 150)

pendown()

begin_fill()

forward(150)

circle(-50, 90)

forward(300)

circle(-50, 90)

forward(300)

circle(-50, 90)

forward(300)

circle(-50, 90)...

1

1 read

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