**Part 1:-**

No box should be empty implies each box should have at least one object . This is same as number onto function $f:A->B$

where $|A|=7$ and $|B|=3$

Number of onto function = $3^{7}-3*2^{7}+3=1806$

**Part 2:-**

Number of arrangement where any box can be empty= total number of arrangement $-$ number of arrangement with no box is empty

Number of arrangement where any box can be empty= $3^{7}-1806=381$