there n x n 0indexed grid artifact bury you give integer n 0indexed 2D integer array artifact describe position rectangular artifact artifactsi r1i c1i r2i c2i denote ith artifact bury subgrid wherer1i c1i coordinate topleft cell ith artifact andr2i c2i coordinate bottomright cell ith artifactYou excavate cell grid remove mud if cell artifact bury underneath uncover if part artifact uncover extract itgiven 0indexe 2D integer array dig digi ri ci indicate excavate cell ri ci return number artifact extractthe test case generate thatNo artifact overlapeach artifact cover 4 cellsthe entry dig unique Example 1input n 2 artifact 00000111 dig 0001output 1explanation the different color represent different artifact excavate cell label D gridThere 1 artifact extract red artifactthe blue artifact cell 11 remain uncover extract itthu return 1example 2input n 2 artifact 00000111 dig 000111output 2explanation both red blue artifact part uncover label D extract return 2 Constraints1 n 10001 artifactslength diglength minn2 105artifactsilength 4digilength 20 r1i c1i r2i c2i ri ci n 1r1i r2ic1i c2ino artifact overlapthe number cell cover artifact 4the entry dig unique