# Chapter 17: AVL Tree Challenges

**URL:** <https://forums.kodeco.com/t/chapter-17-avl-tree-challenges/163816>\
**Category:** Data Structures & Algorithms in Swift\
**Created:** [February 4, 2022, 6:07pm UTC](https://forums.kodeco.com/t/chapter-17-avl-tree-challenges/163816 "2022-02-04T18:07:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev\_invideo](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dev_invideo/32/108702_2.png) [@dev\_invideo](https://forums.kodeco.com/u/dev_invideo)\
**Post date:** [February 4, 2022, 6:07pm UTC](https://forums.kodeco.com/t/chapter-17-avl-tree-challenges/163816/1 "2022-02-04T18:07:11Z")

</div>

The solution for Challenge 1 is wrong. A perfectly balanced tree will always be an odd number.

The return statement should change to  
`Int(pow(2.0, Double(height))) - 1`
