Comments

your code is O(k), dont subtract a[i] by 1 at a time, you can subtract it by batch

+12

guys fst is your skill issue please stop downvoting

+1

just use two maps

tried but wa if you know pls teach me

can someone explain the dp solution for qC?

0

weee this content has so many upvote :smiling_face_with_3_hearts: