Skip to content

Commit c4b4060

Browse files
committed
refactor: replace implementation with linq solution
1 parent d889506 commit c4b4060

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,7 @@ The callback principle, pass `OperationB` as an argument to `OperationA` and let
7373

7474
## Keeping the Focus on Domain Logic with Sequences
7575

76-
- Gap between the semantics of the requirement to find the cheapest painter and the original implementation using looping and branching.
76+
- Gap between the semantics of the requirement to find the cheapest painter and the original implementation using looping and branching.
77+
- Problem: Given a sequence of N elements, find the best fitting one.
78+
- Bad idea: Sorting - sort the sequence and pick the first element. Yields `O(NlogN)` where N is the length of the sequence.
79+
- Better idea: Picking - Yields `O(N)` and execution time should be proportional to the length of the sequence.

0 commit comments

Comments
 (0)