Skip to content

Commit d00e853

Browse files
authored
Added odd_sum and smooth_max solutions
Added odd_sum and smooth_max solutions that I created
1 parent 0e662cc commit d00e853

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Odd Sum
2+
# Given a 2D list, find the sum of all elements at odd indexes for all
3+
# the lists at odd indexes. Print this sum times the sum of all
4+
# first element of all the 1D lists in the 2D list.
5+
#
6+
# Ex:[[1,2,3,6],[2,41,2,1]]should have print 42 after the program runs.
7+
#
8+
# Write the code below.
9+
10+
two_d_list = [[1,2,3,5,2],[2,3,1,4],[2,3,1,2,21],[21,3,1,41]]
11+
#two_d_list should print 51 after the program runs.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Given a 2D list, let's call a element "smooth" if index of the
2+
# element in its 1D list plus the element is even. For example,
3+
# given the 2D list [[0,4][2,6]], the 1st element of each of the
4+
# 1D list is considered "smooth" because 0 + 0 is 0 and 0 + 2 is 2
5+
# (both are even numbers). Find the maximum "smooth" element and
6+
# print it. Using the example [[0,4][2,6]] again, the maximum
7+
# "smooth" element is 2 because 2 is bigger than 0.
8+
9+
two_d_list = [[425,214,412,123],[312,214,123,343]]
10+

0 commit comments

Comments
 (0)