Coding Interview Questions: Row With Max Ones (pt4)

  Рет қаралды 150

Lazy Programmer

Lazy Programmer

Күн бұрын

Пікірлер: 2
@SheenamKumar-tv7cx
@SheenamKumar-tv7cx Жыл бұрын
Hi , I tried something like : def find_max_one(A): rows=len(A) cols=len(A[0]) sum=[] for i in range(0,rows): max_one=-1 for j in range(0,cols): max_one=max_one+A[i][j] sum.append(max_one) Final=sum.index(max(sum)) print("Index of max number of ones is ",Final) i am not trying to count the number of ones rather summing up all ones and get maximum sum of that row, next i am storing that sum in a list then calling the max and index function on it
@LazyProgrammerOfficial
@LazyProgrammerOfficial Жыл бұрын
Thanks for your contribution! Note that the sum function is still O(N). ;)
Coding Interview Questions: Row With Max Ones (pt5)
10:59
Lazy Programmer
Рет қаралды 182
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 38 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 18 МЛН
One day.. 🙌
00:33
Celine Dept
Рет қаралды 56 МЛН
AI Stock Price Prediction Using Large Language Models in Python
8:41
Unboxing the Raspberry Pi CM5 Development Kit
11:36
Level 2 Jeff
Рет қаралды 57 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 7 М.
Why I Chose Copywriting as a Beginner
9:08
Harleen Saini
Рет қаралды 546
Dynamic Programming 1D - Full Course - Python
2:59:19
NeetCode
Рет қаралды 260 М.
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 405 М.
Math 0-1: Probability for Data Science & Machine Learning Intro
5:03
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 38 МЛН