Is there any other logic except this to salve pascal triangle

your approach is great and most optimized one