Skip to content

Latest commit

 

History

History

last-digits-of-n-2-equals-equals-n

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

This is a very simply formulated task. Let's call an integer number N 'green' if ends with all of the digits of N. Some examples:

5 is green, because 5² = 25 and 25 ends with 5.

11 is not green, because 11² = 121 and 121 does not end with 11.

376 is green, because 376² = 141376 and 141376 ends with 376.

Your task is to write a function green that returns nth green number, starting with 1 - green (1) == 1


Data range

`n <= 5000` for Java