Utopian Tree : HackerRank Solution in Python

Period  Height
0 1
1 2
2 3
3 6
4 7
5 14
  • int n: the number of growth cycles to simulate
  • int: the height of the tree after the given number of cycles

Solution in Python 3

--

--

--

pretending to teach is one of the best way to learn.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Blur Faces in real time with Opencv, Mediapipe and Python

Top 5 Tasks to Automate with Desktop Automation

Why It’s Crucial to Have DesignOps

Enhancing Least Frequently Used Caches with Dynamic Aging

Switch Expression (JEP 361)

Reader/Writer Problem with Writer Preference.

Demystifying Deployment labels in Kubernetes

Brinc.fi Announcement: ◈◇ BRC:gBRC Staking Ratio To Change

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shounak Lohokare

Shounak Lohokare

pretending to teach is one of the best way to learn.

More from Medium

S.O.L.I.D Principles in Python

Is Java or Python Better?

LeetCode 15. 3Sum — Python Solution

Maximum Product Subarray Python Leetcode,GeeksForGeeks