Interesting thing that I knew about combinations - is that you can… — andreyka26_se — TG.ME

andreyka26_seDaily 435th day streak Pretty hard problem (to build intuition for). Implementation is quite easy. It is pretty unique, apart from one nice math trick you would learn here. Otherwise no pattern I would not recommend. The math trick will be shown separately…
Interesting thing that I knew about combinations - is that you can precompute them using pascal triangle.

Generally the formula is:
C(n, k) = n! / (k! · (n − k)!)

Pascal triangle formula is:
C(n, k) = C(n−1, k−1) + C(n−1, k)

===

It is nice, cause I always keep forgetting combinations formula, and it is very hard for me to recreate it from the simple examples.

Now on the interview I can just state: there is formula, I don't remember but I know Pascal triangle will do the job.

#leetcode #datastructures #math
👍3❤1
18 октября 2026 г. 388 2