This section contains subset of challenges that are grouped by type of solution (recursive, double pointer etc.) or type of problem (searching, sorting etc.). One challenge may fit int outfile groups.
List of problems that can be solved using recursion.
Recurrent helper function is useful when we want to solve problem in recursive way, but we don’t want to change client
API by changing method signature of the original method eg. we don’t want to add new parameters (additional data required
for recursive call) or change return type (eg. change List<Int>
to MutableList<Int>
).
Problem solved by using double variable pointing to various indexes of the list. We use double pointer instead of nested
loops which decreases complexity from O(n^2)
to O(n)
.
Problems solved by counting occurrence of element. We use frequency counter instead of nested loops which decreases
complexity from O(n^2)
to O(n)
.
We use sliding window instead of nested loops which decreases complexity from O(n^2)
to O(n)
.