# Chapter 4, Challenge 2 Solution does not match problem description

**URL:** <https://forums.kodeco.com/t/chapter-4-challenge-2-solution-does-not-match-problem-description/44965>\
**Category:** Data Structures & Algorithms in Swift\
**Created:** [July 22, 2018, 2:30pm UTC](https://forums.kodeco.com/t/chapter-4-challenge-2-solution-does-not-match-problem-description/44965 "2018-07-22T14:30:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianlawson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brianlawson/32/81494_2.png) [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Post date:** [July 22, 2018, 2:30pm UTC](https://forums.kodeco.com/t/chapter-4-challenge-2-solution-does-not-match-problem-description/44965/1 "2018-07-22T14:30:08Z")

</div>

The problem asks for the middle node to be returned. The example returns a list starting at the middle node. Not quite the same thing. 🙂

---

<div class="post-metadata">

**Author:** ![brianlawson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brianlawson/32/81494_2.png) [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Post date:** [July 22, 2018, 3:09pm UTC](https://forums.kodeco.com/t/chapter-4-challenge-2-solution-does-not-match-problem-description/44965/2 "2018-07-22T15:09:17Z")

</div>

On a related note, since lists conform to the Collection protocol which has a count property, wouldn’t it be simpler to `return list.node(at: list.count / 2)`? (I know, it avoids using the list structure being taught 😉)

---

<div class="post-metadata">

**Author:** ![kelvin\_lau](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kelvin_lau/32/109371_2.png) [@kelvin\_lau](https://forums.kodeco.com/u/kelvin_lau)\
**Post date:** [July 23, 2018, 9:37pm UTC](https://forums.kodeco.com/t/chapter-4-challenge-2-solution-does-not-match-problem-description/44965/3 "2018-07-23T21:37:42Z")

</div>

I know the node/list duality is a little ambiguous, I’m open to suggestions 🙂

An idea I’ve had is to instantiate a brand new node with the same value as the middle node, but then I would argue that isn’t the real “middle node” of the list.

Note that `list.count` is `O(n)` and `node(at:)` is also `O(n)`.

---

<div class="post-metadata">

**Author:** ![brianlawson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brianlawson/32/81494_2.png) [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Post date:** [July 23, 2018, 9:50pm UTC](https://forums.kodeco.com/t/chapter-4-challenge-2-solution-does-not-match-problem-description/44965/4 "2018-07-23T21:50:29Z")

</div>

Thanks Kevin, I had forgotten that count is O(n).
