Function to check out whether the number is Munchhausen Number or not
function isMunchhausen ( n ) { var sum = 0 ; var temp = n ; while ( temp > 0 ) { var index = temp % 10 ; sum = sum + pwr [ index ] ; temp = parseInt ( temp / 10 ) ; } return ( sum == n ) ; } function printMunchhausenNumbers ( n ) { pwr = Array . from ( { length : 10 } , ( _ , i ) => 0 ) ;