Category: Python

  • Tic Tac Toe

    Professional projectPython code solution and explanation Introduction Tic tac toe is a classic paper-pencil game played among young children across the world, and it’s widely known for its simple rules. It is played by marking an X or an O on a 3×3 grid. The first person to mark three of their signs in a…

  • Roman to Integer

    Leetcode qs.13Python code solution and explanation question Given a roman numeral, convert it to an integer. Example Input: s = “MCMXCIV” Output: 1994 Explanation: M = 1000, CM = 900, XC = 90 and IV = 4. thoughts Once you’ve understood the question, what we basically need to do is find a way to tell…

  • Climbing Stairs

    Leetcode qs.70Python code solution and explanation Question You are climbing a staircase. It takes n steps to reach the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example Input: n = 2 Output: 2 Explanation: There are two ways to climb to…