staircase hackerrank solution in c ,c++,python,java