1 min readAug 12, 2020
Hello Ritwik.
Thanks for the question. But the program is correct because we need to count deletions one letter strings too. For example if we have a string “abcd”, in order to make all characters unique we need to remove 3 of characters. But if you put the counter into the if block you will count decreasing of multicharacter strings.