Category: algorithms
On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; Decrement: Subtract …
You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot turn around and drive west.) Given a …
Given an array A of integers, we must modify the array in the following way: we choose an i and replace A with -A, and we repeat this process …
A Leap year occurs mostly every 4 years, but every 100 years, we skip a leap year, unless it is divisible by 400. Leap Year Algorithm if (year is …
The k-digit number N is an Armstrong number if and only if the k-th power of each digit sums to N. Given a positive integer N, return true if …