Tag: math
Write a program to swap odd and even bits in an integer with as few instructions as possible (e.g., bit 0 and bit 1 are swapped, bit 2 and …
An array contains all the integers from 0 to n, except for one number which is missing. Write code to find the missing integer. Can you do it in O(n) …
A number is called stepping number if all adjacent digits have an absolute difference of 1. For example, 321 is a stepping number while 421 is not. Given an …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a non-empty array of decimal digits representing a non-negative integer, increment one to the integer. The digits are stored such that …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given an integer n, return the number of trailing zeroes in n! Could you write a solution that works in …