you give integer array card cardsi represent value ith card a pair card match card valuereturn minimum number consecutive card pick pair matching card pick card if impossible matching card return 1 example 1input card 342347output 4explanation we pick card 3423 contain match pair card value 3 note pick card 4234 optimalExample 2input card 1053output 1explanation there way pick set consecutive card contain pair matching card Constraints1 cardslength 1050 cardsi 106