int sum=0; for(;num>0;sum+=num%10,num/=10); // This is the “single line”.kodeknight programming See alsoFor a Given node of a binary tree, print the K distance nodes.Find the distance between 2 nodes in Binary TreeFind the distance between 2 nodes in Binary TreeProgram to count leaf nodes in a binary treeFriend Circle - Hackerrank