Google | Phone Screen | Sum of Perfect Squares & Missing Ranges
2373

Question 1:
A perfect square is a number made by squaring a whole number.

Some examples include 1, 4, 9, or 16, and so on -- because they are the squared results of 1, 2, 3, 4, etc. However, 15 is not a perfect square, because the square root of 15 is not a whole or natural number.

Given some positive integer n, write a method to return the sum of all perfect squares less than n.

Example 1:

Input: n = 10
Output: 14
Explanation: 1 + 4 + 9 = 14

Question 2:
https://leetcode.com/problems/missing-ranges/ (premium)

Comments (5)