<filename>Amazon/count_ways_to_Nth_stairs.py<gh_stars>1-10

import sys
import io
import atexit


class Solution:

    #Function to count number of ways to reach the nth stair
    #when order does not matter.

    # Returns no. of ways to
    # reach sth stair

    def countWays(self, s):

        mod = 1000000007
        # code here
        return (s//2)+1


#{
#  Driver Code Starts
#Initial Template for Python 3

# Contributed by : <NAME>

if __name__ == '__main__':
    test_cases = int(input())
    for cases in range(test_cases):
        m = int(input())
        ob = Solution()
        print(ob.countWays(m))

# } Driver Code Ends

<filename>Amazon/count_ways_to_Nth_stairs.py<gh_stars>1-10

import sys
import io
import atexit


class Solution:

    #Function to count number of ways to reach the nth stair
    #when order does not matter.

    # Returns no. of ways to
    # reach sth stair

    def countWays(self, s):

        mod = 1000000007
        # code here
        return (s//2)+1


#{
#  Driver Code Starts
#Initial Template for Python 3

# Contributed by : <NAME>

if __name__ == '__main__':
    test_cases = int(input())
    for cases in range(test_cases):
        m = int(input())
        ob = Solution()
        print(ob.countWays(m))

# } Driver Code Ends

#Function to count number of ways to reach the nth stair #when order does not matter. # Returns no. of ways to # reach sth stair # code here #{ #  Driver Code Starts #Initial Template for Python 3 # Contributed by : <NAME> # } Driver Code Ends