Implement SnapshotArray support follow interfacesnapshotarrayint length initialize arraylike data structure give length Initially element equal 0void setindex val set element give index equal valint snap take snapshot array return snap_id total number time call snap minus 1int getindex snap_id return value give index time take snapshot give snap_id Example 1input SnapshotArraysetsnapsetget3050600Output nullnull0null5explanation SnapshotArray snapshotarr new SnapshotArray3 set length 3snapshotarrset05 Set array0 5snapshotarrsnap take snapshot return snap_id 0snapshotarrset06snapshotarrget00 get value array0 snap_id 0 return 5 constraints1 length 5 1040 index length0 val 1090 snap_id total number time snapat 5 104 call set snap