InterviewBit Academy is now Scaler!
InterviewBit Academy is now Scaler Academy!

Maximum height of the staircase

Given an integer A representing the square blocks. The height of each square block is 1.
The task is to create a staircase of max height using these blocks.

The first stair would require only one block, the second stair would require two blocks and so on.

Find and return the maximum height of the staircase.

Input Format

The only argument given is integer A.

Output Format

Return the maximum height of the staircase using these blocks.


0 <= A <= 10^9

For Example

Input 1:
    A = 10
Output 1:

Input 2:
    A = 20
Output 2:
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Maximum height of the staircase on Interview Code Editor
Sign Up
to access hints and editorial solutions for Maximum height of the staircase


Click here to start solving coding interview questions