Saltar al contenido principal

17 documentos etiquetados con "math"

Ver Todas las Etiquetas

Add Two Numbers II

Given two linked lists that represent two numbers, return the sum of the numbers also represented as a list.

Climbing Stairs

This question is asked by Google. Given a staircase with N steps and the ability to climb either one or two steps at a time, return the total number of ways to arrive at the top of the staircase.

Count Partners

Given an integer array nums, return the total number of "partners" in the array.

Hamming Distance

This question is asked by Facebook. Given two integers x and y, return the hamming distance between the two numbers.

Happy Number (Magical Number)

Given an integer n, return whether or not it is a "magical" number. A magical number is an integer such that when you repeatedly replace the number with the sum of the squares of its digits, it eventually becomes one.

Missing Number

This question is asked by Amazon. Given an array that contains all distinct values from zero through N except one number, return the number that is missing from the array.

Monotonic Array

This question is asked by Facebook. Given an array nums, return whether or not its values are monotonically increasing or monotonically decreasing.

Open Lockers

This question is asked by Facebook. In a gym hallway there are N lockers. You walk back and forth down the hallway opening and closing lockers. On your first pass you open all the lockers. On your second pass, you close every other locker. On your third pass you open every third locker. After walking the hallway N times opening/closing lockers in the previously described manner, how many lockers are left open?

Plus One

Given an array digits that represents a non-negative integer, add one to the number and return the result as an array.

Power of Three

Given an integer n, return whether or not it is a power of three.

Product of Array Except Self

Given an integer array nums, return an array where each element i represents the product of all values in nums excluding nums[i].

Reverse Integer

This question is asked by Apple. Given a 32-bit signed integer, reverse it and return the result.

Rotate Image

Given an image represented as a 2D array of pixels, return the image rotated 90 degrees clockwise.

Self Divisible Numbers

Given an integer N, return the total number of self divisible numbers that are strictly less than N (starting from one).

Unique Paths

This question is asked by Google. A ball is dropped into a special Galton board where at each level in the board the ball can only move right or down. Given that the Galton board has M rows and N columns, return the total number of unique ways the ball can arrive at the bottom right cell of the Galton board.