Permutations II - 12th Nov LeetCoding Challenge - GoMaster Coding Interviews

preview_player
Показать описание
Nov 12th - November LeetCoding Challenge
A solution to the LeetCode Problem: Permutations II
Backtracking solution to generating permutations with duplicate symbols.

Solution by: Channa Bankapur
GoMaster Coding Interviews
Рекомендации по теме
Комментарии
Автор

Thank you Professor Channa Bankapur :)
The solution was very clear and easy to understand and your explanation helped too.

There are two ways of going about explaining solutions -
1) starting from a blank state and developing code while explaining your thought process
2) starting from the final solution and explaining the motivation behind each line

I'm pretty sure that method (2) is logistically more convenient, but usually method (1) feels more natural and easy to follow. That being said, in the context of the Leetcode challenges, where people might be expected to have attempted it by themselves before coming here, I think it is better because it is quicker, to the point and usually easy to follow.

But in the future, for fairly complicated problems (say leetcode hard), you can try to screen grab while you're coding and then add a voice over + tweak the typing speed to get the best of both worlds. For example, I would have created the helper function first and added a few comments with examples of what my variables might look like. And then move on to handling different cases.
Thoughts?

msurana
Автор

Explanation is quite satisfactory! but please whenever you teach the concept take a blank white sheet behind so that we can grab the concepts easily! I hope you don't mind

deepakbhardwaj
Автор

Is next_permutation(a, a+n) not gonna work?

shreyasingh