---
title: "Comment by GirdhaR on \"Why 100 lines of Code can be better than 2 lines of code...\" | Hashnode"
description: "in the worst case it would be 4 comparisons. in your example if the heaviest ball is either among ball 1,2,4 or 5 then it would take 4 comparisons to find that"
url: "https://hashnode.com/posts/why-100-lines-of-code-can-be-better-than-2-lines-of-code/6815be425b6714a258e60e6b/comment/6815c868e0defe9434067548"
---

[Discussion](https://hashnode.com/posts/why-100-lines-of-code-can-be-better-than-2-lines-of-code/6815be425b6714a258e60e6b)

Comment [Why 100 lines of Code can be better than 2 lines of code...](https://hashnode.com/posts/why-100-lines-of-code-can-be-better-than-2-lines-of-code/6815be425b6714a258e60e6b)

[GirdhaR](https://hashnode.com/@girdhar)

[May 3, 2025](https://hashnode.com/posts/why-100-lines-of-code-can-be-better-than-2-lines-of-code/6815be425b6714a258e60e6b/comment/6815c868e0defe9434067548)

in the worst case it would be 4 comparisons. in your example if the heaviest ball is either among ball 1,2,4 or 5 then it would take 4 comparisons to find that ball
