Rust Day 13: Leetcode — Minimum Depth of Binary Tree
Published in
2 min readMay 2, 2022
Today was an Okish day! I am progressing, as well as managing my studies. I will be focusing my energy on learning TiKV and TiDB soon. TiKV & TiDB seems to have been written with a perfect choice of language. There are many Databases which have taken inspiration from Google Spanner and PingCAP is one amount them. So for now, let's head straight to the problem.
Problem:
Logic:
Code:
Syntax:
match
is used when you have to deal with Option.match( a.left.clone(), a.right.clone() )
is used for pair combinations.- Use clone whenever you are lending control of a variable to a block or a function. You can use
.as_ref()
as well, I guess.
Reference:
Found it Interesting?
Please show your support by 👏.