Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.…
Browsing: Easy
Given two sorted arrays a[] and b[], where each array may contain duplicate elements , the task is to return the elements in the union of the two arrays…
Learn a one-pass way to check if array is sorted in non-decreasing order. Intuition, commented Python code, dry run, and…
Need the second smallest and second largest in one array? We compare a clear two-pass “better” method with a one-pass…
Find the n-th Fibonacci number with a recursive function in Python. Clear problem statement, examples, easy-to-grasp intuition, commented code, dry…
Learn two easy ways to test a Palindrome String: a clean recursive method and a space saving two-pointer loop. Includes…
Learn how to find a topological sort of a directed acyclic graph (DAG) using depth-first search (DFS) and a stack.…
Hi everyone! In this article, we’ll guide you through the Python program to find factorial of number using recursion. The…
Hi everyone, in this article we’ll guide you through the Python program to print from 1 to N without loops…
Hi everyone! In this article, we’ll explain the Python program to print divisors/factors of an integer. Helping you understand better…