Home
Mohd Irfan
Cancel
Python Introduction

01. Introduction to Python

Introduction to Python Python is an interpreted language. It means that Python directly executes the code line by line. It converts the source code that we write into an intermediate language, ...

copy list with random pointer

138. Copy List with Random Pointer

Go to the Problem 138. Copy List with Random Pointer Solution Approach 1: Recursive with O(N) Space In this approach, we take advantage of the fact that we already have a hash map containing ma...

Square Root

03. Find Square Root

Ex 1: For Positive Numbers # Python Program to calculate the square root # Note: change this value for a different result num = 8 # uncomment to take the input from the user #num = float(input('...

Add Two Numbers Program

02. Add Two Numbers

Example 1: Add Two Numbers Program # This program adds two numbers num1 = 1.5 num2 = 6.3 # Add two numbers sum = num1 + num2 # Display the sum print(f'The sum of {num1} and {num2} is {sum}') ...

Hello World Program

01. Print "Hello World!"

1. Hello World Program # This program prints Hello World! on the screen print("Hello World!") In this program, we have used the built-in print() function to print the string Hello, world! on our...

Dynamic Arrays

02. Dynamic Arrays

Problem: Dynamic Arrays Solution 1: Using for loop and if-else statement def dynamicArray(n, queries): seqList = [[] for _ in range(n)] lastAnswer = 0 result = [] for query in que...

Learn Data Science step by step

Learn Data Science step by step

Introduction to Data Science Data Science Importance is growing day by day. Data Science is a combination of various tools, algorithms, and machine learning principles with the goal to discover hi...

Arrays - DS

01. Arrays - DS

Problem: Arrays - DS Solution 1: Using for loop and storing in another array def reverseArray(a): arr = [] for i in range(len(a) - 1, -1, -1): arr.append(a[i]) return arr Sol...

Introduction to Linked List

1. Introduction to Linked List

1. Introduction to linked list What is Linked List Like arrays, a Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at a contiguous location; the elements...

H