print the path
for ( int ele : path ) System . out . print ( ele + " ▁ - > ▁ " ) ; System . out . println ( cur ) ; } static int accumulate ( int [ ] arr , int sum ) { for ( int i : arr ) sum += i ; return sum ; }