temp = new ArrayList<>();
+ for(int j=0; j < m;j++) {
+ int ele = A.get(i).get(j);
+ if(freq(A.get(i),ele) == 1) {
+ temp.add(ele);
+ }
+ }
+
+ ans.add(temp);
+ }
+
+ return ans;
+ }
+```
+---
+
+### Problem:
+Given an array A of N integers.
+Count the number of elements that have at least 1 elements greater than itself.
+
+### Example1:
+```java
+A = [3, 1, 2]
+```
+```java
+Output:
+2
+```
+
+### Example 2:
+```java
+A = [-17, 15, 6, 3, 15, 7, -19, 15]
+```
+
+```java
+Output:
+8-3 = 5
+```
+---
+
+
+TODO:
+
+1. Find the max in array using 1 loop.
+2. Count the frequency of max in array using 1 loop.
+3. ans= total no of elements(ar.length)- count
+
+---
+
diff --git a/Academy DSA Typed Notes/Beginner Language/Beginner String Implementation.md b/Academy DSA Typed Notes/Beginner Language/Beginner String Implementation.md
new file mode 100644
index 0000000..4472309
--- /dev/null
+++ b/Academy DSA Typed Notes/Beginner Language/Beginner String Implementation.md
@@ -0,0 +1,379 @@
+# String Implementation
+
+
+---
+
+1. Introduction to Characters
+2. ASCII Introduction
+3. Sum of digits in the string with characters and digits
+4. Replace all the characters 'x' with '$'
+5. Count uppercase and lower case characters
+6. Count number of characters of first string present in the second string
+
+
+
+---
+
+### Character:
+A character represent a single symbol.
+
+There are different types of characters:
+* Uppercase characters : ['A' - 'Z']
+* Lowercase characters : ['a' - 'z']
+* Numeric characters: ['0' - '9']
+* Special characters: ['@', '#', '\$', '%', '&'...]
+
+There are a total of 128 characters.
+
+## Syntax
+
+**Example 1:**
+```java
+char ch = 'a';
+System.out.println(ch);
+```
+**Output:**
+```plaintext
+a
+```
+
+**Example 2:**
+```java
+char ch = 'ab';
+System.out.println(ch);
+```
+**Output:**
+```plaintext
+Error: Only a single symbol is a character.
+```
+---
+
+
+## Why do we need ASCII Codes?
+
+
+
+
+---
+
+
+## ASCII Codes
+ASCII stands for **American Standard Code for Information Interchange.**
+
+These codes are a standardized system of assigning a unique numeric value to each character in the English language and other common characters, such as punctuation marks and symbols.
+
+
+
+
+
+
+
+
+## Show the ASCII table in the class
+
+
+
+---
+
+
+
+#### Definition
+In programming, a string is a data type used to represent a sequence of characters.
+
+#### Syntax
+The syntax for declaring and initializing a string variable in Java is:
+```java
+String str = "Hello World!"; // Double quotes are used to define a string
+```
+
+
+#### Example -
+```java
+String str = "How are you?"
+print(str) // How are you? will be printed
+```
+
+#### Indexing
+String indexing starts from 0, where the first character is at index 0, the second character is at index 1, and so on.
+
+**Example -**
+```java
+String str = "Hello, World!";
+System.out.println(str.charAt(0)); // Output: 'H'
+System.out.println(str.charAt(7)); // Output: 'W'
+```
+
+---
+
+
+### Properties of a String
+Some of the most commonly used properties of a string include:
+
+* **Length:** The length() method of the String class returns the number of characters in a string. For example,
+```java
+String str = "Priyanshi";
+int n = str1.length(); // assigns 9 to variable n as str has 9 characters.
+System.out.println(str.length()); // 9
+```
+
+* **Access a character:** The charAt(index) method of the String class returns the character at that index in a string. Indexing in string is same as that in array and starts from 0. For example,
+```java
+String str = "Priyanshi";
+System.out.println(str.charAt(5)); // output will be 'n'.
+```
+
+* **Iterate a string:** We can iterate over the characters of a string using a loop. One way to do this is to use a for loop that iterates over the index positions of the string, and then use the charAt() method to retrieve the character at each position. For example,
+```java
+String str = "Priyanshi";
+for (int i = 0; i < str.length(); i++) {
+ System.out.println(i + " -> " + str.charAt(i));
+}
+```
+
+* **Update a string:** In Java, strings are immutable, meaning that their contents cannot be changed after they are created.
+* **Concatenating characters to String:** In Java, a character can be concatenated after a string by using the + or += operator, or through the concat() method, defined in the java. lang. String class.
+
+```java
+// Concatentaion example
+
+String s1 = "Hello";
+String s2 = s1 + "Everyone";
+System.out.println(s2); // Output will be "Hello Everyone"
+
+
+String s3 = "Hi";
+s3 = s3 + 'i';
+System.out.println(s3); // Output will be "Hii"
+
+s3 = 'e' + s3;
+System.out.println(s3); // Output will be "eHii"
+
+s3 = "Bye " + s3;
+System.out.println(s3); // Output will be "Bye eHii"
+```
+
+
+---
+
+
+#### Problem statement:
+Given a string s, you have to find the length of the longest word in the input string.
+
+### Exanple 1:
+
+Input:
+ hi hello bye
+
+Output:
+5
+
+Explanation:
+In the sentence "hi hello bye", hello is the longest word, whose length is 5.
+
+---
+
+ # Question
+Given string A, "coding is awesome"
+find the length of the longest word in the given string.
+
+# Choices
+- [x] 7
+- [ ] 6
+- [ ] 5
+- [ ] I dont know
+
+---
+
+
+### Explanation
+
+In the sentence "coding is awesome", awesome is the longest word, whose length is 7.
+
+
+---
+
+
+```java
+public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ String line = scanner.nextLine();
+
+ int maxLength = 0;
+ int currentLength = 0;
+
+ for (int i = 0; i < line.length(); i++) {
+ char currentChar = line.charAt(i);
+
+ if (currentChar != ' ') {
+ currentLength++;
+ } else {
+ if (currentLength > maxLength) {
+ maxLength = currentLength;
+ }
+ currentLength = 0;
+ }
+ }
+
+ if (currentLength > maxLength) {
+ maxLength = currentLength;
+ }
+ System.out.println(maxLength);
+ scanner.close();
+ }
+```
+---
+
+
+### Problem
+Given a string A of length N and a character B, replace all occurrences of B in string A with character '@'.
+
+**Input Format**
+
+First line is String A
+Second line is Character B
+
+**Example:**
+abcad
+a
+
+**Output:**
+@bc@d
+
+---
+
+
+# Question
+Given string A,"interviewbit"
+String B= "i"
+replace all occurrences of B in string A with character '@'.
+
+# Choices
+- [x] @nterv@ewb@t
+- [ ] i@terv@ewb@t
+- [ ] @ntervewb@t
+- [ ] I dont know
+
+---
+
+### Explanation
+
+Modified string after Replacement of i at 1st, 7th, and 11th position is @nterv@ewb@t
+
+---
+
+
+### Idea:
+1. Initialization: Create an empty string result.
+2. Iterate: Loop through each character in the input string.
+3. Check and Replace: If the current character matches the target character, append '@' to the result; otherwise, append the current character.
+4. Final Result: Return the modified string (result).
+
+
+### Psuedo code
+```java
+static String replaceCharacter(String str, char targetChar) {
+ String result = "";
+
+ for (int i = 0; i < str.length(); i++) {
+ char currentChar = str.charAt(i);
+ if (currentChar == targetChar) {
+ result += '@';
+ } else {
+ result += currentChar;
+ }
+ }
+
+ return result;
+ }
+```
+---
+
+
+### Problem:
+Given a string, Count uppercase and lower case characters and print the values.
+
+
+### Example:
+String str="Hello World"
+
+**Output:**
+Uppercase: 2
+Lowercase: 8
+
+
+---
+
+
+# Question
+Given string ElePHant
+Count number of Uppercase character first, then lowercase characters.
+
+# Choices
+- [ ] 3 lowercase
5 uppercase
+- [x] 3 uppercase
5 lowercase
+- [ ] 5 uppercase
9 lowercase
+- [ ] I dont know
+
+---
+
+
+```java
+public static void main(String args[]) {
+ Scanner scn = new Scanner(System.in);
+ String str = scn.next();
+
+ int c1 = 0;
+ int c2 = 0;
+
+ for (int i = 0; i < str.length(); i++) {
+ char ch = str.charAt(i);
+
+ if (ch >= 'A' && ch <= 'Z') {
+ c1++;
+ } else if (ch >= 'a' && ch <= 'z') {
+ c2++;
+ }
+ }
+
+ System.out.println(c1);
+ System.out.println(c2);
+
+ }
+```
+
+---
+
+### Problem:
+
+Count number of characters of first string present in the second string.
+
+### Example:
+String A=abbd
+String B=aabb
+
+Output:
+Number of common characters: 3(a,b,b)
+
+### Pseudo Code
+
+```java
+static int countCommonCharacters(String str1, String str2) {
+ int count = 0;
+
+ for (int i = 0; i < str1.length(); i++) {
+ char currentChar = str1.charAt(i);
+
+ for (int j = 0; j < str2.length(); j++) {
+ if (currentChar == str2.charAt(j)) {
+ count++;
+ break; // Break the inner loop once a common character is found
+ }
+ }
+ }
+
+ return count;
+ }
+```
+
+------
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays 2D Matrices.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays 2D Matrices.md
new file mode 100644
index 0000000..c7afb37
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays 2D Matrices.md
@@ -0,0 +1,480 @@
+# 2D Matrices
+
+### Definition
+A 2D matrix is a specific type of 2D array that has a rectangular grid of numbers, where each number is called an element. It is a mathematical structure that consists of a set of numbers arranged in rows and columns.
+2D matrix can be declared as:
+
+```
+int mat[N][M];
+```
+*int* is the datatype.
+*mat* is the matrix name.
+*N* is the number of rows in matrix.
+*M* is the number of columns in matrix.
+
+*mat[i][j]* represents the element present in the *i-th* row of *j-th* column.
+
+Below is the pictorial representation of 2D matrix.
+
+
+
+
+**Note:** A matrix having *N* rows and *M* columns can store **N*M** elements.
+
+
+
+### Question
+
+Given a matrix of size NxM. What will be the index of the top right cell?
+Choose the correct answer
+
+**Choices**
+- [ ] 0,0
+- [ ] 0,M
+- [ ] M-1,0
+- [x] 0,M-1
+
+
+### Question
+
+Given a matrix of size NxM. What will be the index of the bottom right cell?
+Choose the correct answer
+
+**Choices**
+- [ ] N,M
+- [ ] M,N
+- [x] N-1,M-1
+- [ ] M-1,N-1
+
+### Question 1 : Given a matrix print row-wise sum
+
+**Problem Statement**
+Given a 2D matrix mat[N][M], print the row-wise sum.
+
+#### TestCase
+
+**Input:**
+
+```
+mat[3][4] = {
+ {1,2,3,4},
+ {5,6,7,8},
+ {9,10,11,12}
+}
+```
+
+**Output:**
+
+```
+10
+26
+42
+```
+
+### Approach
+
+The approach is to traverse each row and while traversing take the sum of all the elements present in that row.
+
+### Pseudocode:
+```cpp
+function SumRow(int mat[N][M]) {
+ for (int i = 0; i < N; i++) {
+ int sum = 0;
+ for (int j = 0; j < M; j++) {
+ sum = sum + mat[i][j];
+ }
+ print(sum);
+ }
+}
+```
+
+
+### Question
+
+What is the time and space complexity of to calculate row-wise sum for a matrix of size N*M?
+Choose the correct answer
+
+**Choices**
+- [ ] TC: O(N^2), SC: O(n)
+- [ ] TC: O(N^2), SC: O(1)
+- [ ] TC: O(N^M), SC: O(n)
+- [x] TC: O(N*M), SC: O(1)
+
+
+Since we are iterating over all the elements just once, hence
+Time Complexity: **O(N*M)**.
+
+We are not using any extra space,
+Space Complextiy: **O(1)**.
+
+### Question 2 : Given a matrix print col-wise sum
+
+Given a 2D matrix mat[N][M], print the column-wise sum.
+
+**TestCase**
+
+```
+mat[3][4] = {
+ {1,2,3,4},
+ {5,6,7,8},
+ {9,10,11,12}
+}
+```
+
+**Output**
+
+```
+15 18 21 24
+```
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Approach
+
+While traversing each column, we can calculate sum of all the elements present in that column.
+
+### Pseudocode
+```cpp
+function SumColumn(int mat[N][M]) {
+ for (int j = 0; j < M; j++) {
+ int sum = 0;
+ for (int i = 0; i < N; i++) {
+ sum = sum + mat[i][j];
+ }
+ print(sum);
+ }
+}
+```
+
+#### Complexity
+Time Complexity: **O(N*M)**.
+Space Complextiy: **O(1)**.
+
+### Question 3 : Given a square matrix print diagonals
+
+Given a matrix 2D square matrix mat[N][N], print diagonals.
+
+How many main Diagonals are there in a square matrix?
+$2.$
+
+1. **Principal Diagonal:** From top left to bottom right.
+3. **Anti Diagonal:** From top right to bottom left.
+
+
+
+
+First, let's print **Principal Diagonal**
+
+**TestCase**
+
+```
+mat[3][3] = {
+ {1,2,3},
+ {5,6,7},
+ {9,10,11}
+}
+```
+
+**Output:**
+
+```
+1 6 11
+```
+### Question 3 Approach
+
+#### Pseudocode:
+```cpp
+function PrintDiagonal(int mat[N][N]) {
+ int i = 0;
+ while (i < N) {
+ print(mat[i][i]);
+ i = i + 1;
+ }
+}
+```
+
+
+### Question
+
+Given a matrix of size NxN. What will be the time complexity to print the diagonal elements?
+Chose the correct answer
+
+**Choices**
+- [ ] O(N*sqrt(N))
+- [x] O(N)
+- [ ] O(N^2)
+- [ ] O(NlogN)
+
+
+Since i starts at 0 and goes till N-1, hence there are total N iterations.
+
+Time Complexity: **O(N)**.
+Space Complextiy: **O(1)**.
+
+### Given square matrix, print **Anti-diagonal**
+
+**TestCase**
+```
+mat[3][3] = {
+ {1,2,3},
+ {5,6,7},
+ {9,10,11}
+}
+```
+
+**Output:**
+
+```
+3 6 9
+```
+
+### Pseudocode:
+```cpp
+function PrintDiagonal(int mat[N][N]) {
+ int i = 0, j = N - 1;
+ while (i < N) {
+ print(mat[i][j]);
+ i++;
+ j--;
+ }
+}
+```
+
+### Complexity
+Time Complexity: **O(N)**.
+Space Complextiy: **O(1)**.
+
+### Question 4 Print diagonals in a matrix (right to left)
+
+
+**Problem Statement**
+Given a 2D matrix mat print all the elements diagonally from right to left
+
+**TestCase**
+
+```
+mat[3][4] = {
+ {1,2,3,4},
+ {5,6,7,8},
+ {9,10,11,12}
+}
+```
+
+**Output:**
+
+```
+1
+2 5
+3 6 9
+4 7 10
+8 11
+12
+```
+
+
+### Question
+
+Given a matrix of size N*M, how many Right to Left diagonals will be there?
+
+Choose the correct Options
+
+**Choices**
+- [ ] N*M
+- [ ] N+M
+- [x] N+M-1
+- [ ] N+M+1
+
+
+1. M diagonals are starting from first row.
+2. N diagonals start from last column.
+3. There is a common diagonal at index 0, M-1.
+
+So, total count = N+M-1 Let's take an example as shown below:
+
+
+
+### Question
+
+Given a matrix of size 4x5, how many Right to Left diagonals will be there?
+Choose the correct answer
+
+**Choices**
+- [x] 8
+- [ ] 11
+- [ ] 9
+- [ ] 10
+
+### Question 4 Approach
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+* For every start of the diagonal, how do the indices change when we iterate over it?
+Row number increments by 1 and column number decrements by 1 as shown in the diagram.
+
+
+### Pseudocode
+```cpp
+function print_diagonal_elements(A[N][M]) {
+ //print all diagonals starting from 0th row
+ i = 0
+ for (j = 0; j < M; j++) {
+ s = i;
+ e = j;
+ while (s < N && e >= 0) {
+ print(A[s][e])
+ s++
+ e—
+ }
+ print(“\n”)
+ }
+
+ //print all diagonals starting from last column
+ j = M - 1
+ for (i = 1; i < N; i++) {
+ s = i;
+ e = j;
+ while (s < N && e >= 0) {
+ print(A[s][e])
+ s++
+ e—
+ }
+ print(“\n”)
+ }
+}
+```
+### Question
+
+Time Complexity of printing all the diagonals of a matrix of dimensions N X M?
+Choose the correct answer
+
+**Choices**
+- [ ] O(N^2 * M^2)
+- [ ] O(N^2 + M^2)
+- [ ] O(N + M)
+- [x] O(N * M)
+
+### Question 5 : Transpose of a square matrix
+
+**Problem Statement**
+Given a square 2D matrix mat[N][N], find transpose.
+
+**Transpose of matrix**
+The transpose of a matrix is a new matrix obtained by interchanging the rows and columns of the original matrix.
+
+
+**TestCase**
+
+```
+mat[3][3] = {
+ {1,2,3},
+ {5,6,7},
+ {9,10,11}
+}
+```
+
+**Output:**
+
+```
+{
+{1,5,9},
+{2,6,10},
+{3,7,11}
+}
+```
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Question 5 Approach
+
+#### Observation
+* After performing the transpose, what is same in the original matix and its transpose ?
+The diagonal that starts from (0,0) is same.
+
+* Along the diagonals, the elements have swapped their positions with corresponding elements.
+
+#### PseudoCode
+```cpp
+function find_transpose(matrix[N][N]){
+ for(int i = 0; i < N; i++){
+ for(int j = i + 1; j < N; j++){
+ swap(matrix[i][j],matrix[j][i]);
+ }
+ }
+}
+```
+**Note:** If we start j at 0, the matrix will come back to its original position.
+
+### Question
+What is the time and space complexity to find transpose of a square matrix?
+Chose the correct answer
+
+**Choices**
+- [ ] TC: O(N), SC: O(n)
+- [ ] TC: O(N^2), SC: O(n)
+- [x] TC: O(N^2), SC: O(1)
+- [ ] O(N), SC: O(1)
+
+**Complexity**
+Time Complexity: **O(N^2)**.
+Space Complextiy: **O(1)**.
+
+### Question 6 Rotate a matrix to 90 degree clockwise
+
+
+**Problem Statement**
+Given a matrix mat[N][N], rotate it to 90 degree clockwise.
+
+**TestCase**
+```
+{
+{1,2,3},
+{4,5,6},
+{7,8,9}
+}
+```
+**Output**
+```
+{
+{7,4,1},
+{8,5,2},
+{9,6,3}
+}
+```
+### Question 6 Approach
+
+### Hint:
+* What if we first find the transpose of the matrix?
+* Is there any relation between rotated matrix and transposed matrix ?
+
+:::warning
+Using the Hints, please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Observation:
+Yes, if we reverse all the rows, then it will become rotated matrix.
+The rotated matrix looks like:
+
+
+**Transpose and rotated matrix:**
+
+
+#### PseudoCode
+```cpp
+Function rotate(int mat[N][N]) {
+ mat = transpose(mat);
+ for (int i = 0; i < N; i++) {
+ reverse(mat[i]);
+ }
+ return mat;
+}
+```
+#### Complexity
+Time Complexity: **O(N*N)**.
+Space Complextiy: **O(1)**.
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays Sliding Window & Contribution Technique.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays Sliding Window & Contribution Technique.md
new file mode 100644
index 0000000..f9d2557
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays Sliding Window & Contribution Technique.md
@@ -0,0 +1,393 @@
+# Sliding Window & Contribution Technique
+
+## Problem 1 : Find the max sum out of all possible subarray of the array
+
+### Problem Statement
+Given an array of integers, find the total sum of all possible subarrays.
+**#Note:** This question has been previously asked in *Google* and *Facebook*.
+
+### Solution
+* We can use the previous approach, where we calculated all sum subarray using Carry Forward technique.
+* Instead of keeping track of maximum, we can simply add the sums in a variable.
+
+### Pseudocode
+```cpp
+int sumOfAllSubarraySums(int arr[], int n) {
+ int total_sum = 0;
+ for (int i = 0; i < n; i++) {
+ int subarray_sum = 0;
+ for (int j = i; j < n; j++) {
+ subarray_sum += arr[j];
+ total_sum += subarray_sum;
+ }
+ }
+ return total_sum;
+}
+```
+### Time and Space Complexity
+* TC - O(n^2)
+* SC - O(1)
+
+## Problem 2 : Contribution Technique
+
+We can optimize the above solution further by observing a pattern in the subarray sums.
+Let's take the example array ``[1, 2, 3]``. The subarrays and their sums are:
+
+```
+[1] -> 1
+[1, 2] -> 3
+[1, 2, 3] -> 6
+[2] -> 2
+[2, 3] -> 5
+[3] -> 3
+Total Sum = 1+3+6+2+5+3 = 20
+```
+
+Instead of generating all subarrays, we can check that a particular element appears in how many subarrays and add its contribution that many times to the answer.
+
+* the first element 1 appears in 3 subarrays: [1], [1, 2], and [1, 2, 3].
+* the second element 2 appears in 4 subarrays: [2], [1, 2], [2, 3], and [1, 2, 3].
+* the third element 3 appears in 3 subarrays: [3], [2, 3], and [1, 2, 3].
+
+Total = $(1*3) + (2*4) + (3*3) = 20$
+
+
+
+:::warning
+Please take some time to think about "How to calculate the number of subarrays in which A[i] appears?" on your own before reading further.....
+:::
+
+
+### Question
+In how many subarrays, the element at index 1 will be present?
+A: [3, -2, 4, -1, 2, 6 ]
+
+**Choices**
+- [ ] 6
+- [ ] 3
+- [x] 10
+- [ ] 8
+
+**Explanation:** The subarrays in which the element at index 1 is present are -
+[3, -2], [3, -2, 4], [3, -2, 4, -1], [3, -2, 4, -1, 2], [3, -2, 4, -1, 2, 6], [-2], [-2, 4], [-2, 4, -1], [-2, 4, -1, 2], [-2, 4, -1, 2, 6 ]. There are total 10 such subarrays.
+
+### Question
+In how many subarrays, the element at index 2 will be present?
+A: [3, -2, 4, -1, 2, 6 ]
+
+**Choices**
+- [ ] 6
+- [x] 12
+- [ ] 10
+- [ ] 8
+
+**Explanation:** The subarrays in which the element at index 1 is present are -
+[3, -2, 4], [3, -2, 4, -1], [3, -2, 4, -1, 2], [3, -2, 4, -1, 2, 6], [-2, 4], [-2, 4, -1], [-2, 4, -1, 2], [-2, 4, -1, 2, 6], [4], [4, -1], [4, -1, 2], [4, -1, 2, 6 ]. There are total 12 such subarrays.
+
+### Find sum of all Subarrays sums continued
+**Generalized Calculation -**
+The start of such subarrays can be $0, 1, ..i$
+The end of such subarrays can be $i, i+1, i+2, ...n-1$
+
+Elements in range [0 i] = $i+1$
+Elements in range [i n-1] = $n-1-i+1 = n-i$
+Thus, the total number of subarrays containing arr[i] is i+1 multiplied by n-i.
+
+This gives us the expression `(i+1) * (n-i)`.
+
+We can use this pattern to compute the total sum of all subarrays in O(n) time complexity. The steps are as follows:
+* Initialize a variable total_sum to zero.
+* Iterate over all elements of the input array arr. For each element arr[i], compute `arr[i] * (i+1) * (n-i)` and add it to total_sum.
+* Return total_sum as the output of the function.
+
+#### Pseudocode
+```cpp
+int sumOfAllSubarraySums(arr[]) {
+ int n = arr.size();
+ int total_sum = 0;
+
+ // Iterate over all elements of the array and compute the sum of all subarrays containing that element
+ for (int i = 0; i < n; i++) {
+ total_sum += arr[i] * (i + 1) * (n - i);
+ }
+
+ return total_sum;
+}
+```
+#### Time and Space Complexity
+* TC - O(n)
+* SC - O(1)
+
+### Total number of subarrays of length K
+
+
+Number of subarrays of length K = Total number of start indices of subarrays of length K.
+
+
+
+| length (K) | start of first window | start of last window |
+| -------- | -------- | -------- |
+| 1 | 0 | N-1 |
+| 2 | 0 | N-2 |
+| 3 | 0 | N-3 |
+| 4 | 0 | N-4 |
+| K | 0 | N-K |
+
+All start positions for length K, will be within range **[0 N-K]**. Therefore total is N-K+1.
+
+Hence, total number of subarrays of length K = **N-K+1**.
+
+
+
+
+### Question
+Given N=7, K=4, what will be the total number of subarrays of len K?
+
+**Choices**
+- [ ] 3
+- [x] 4
+- [ ] 5
+- [ ] 6
+
+
+## Problem 3 Given an array, print start and end indices of subarrays of length K.
+
+
+Given an array of size N, print start and end indices of subarrays of length K.
+
+**Example**
+
+If N=8, K=3
+All start and end indices are
+
+
+| start | end |
+| ----- | ----- |
+| 0 | 2 |
+| 1 | 3 |
+| 2 | 4 |
+| 3 | 5 |
+| 4 | 6 |
+| 5 | 7 |
+
+[start end] = K
+end - start + 1 = K
+end = K + start - 1
+
+#### Pseudocode
+```cpp=
+//Iterate over all the start indices
+for (int i = 0; i <= N - K; i++) {
+ int j = K + i - 1;
+
+ print(i, j);
+}
+```
+
+> Note: Now we know how to iterate over windows of length K.
+
+## Problem 4 : Given an array, print maximum subarray sum with length K
+
+
+Given an array of N elements. Print maximum subarray sum for subarrays with length = K.
+
+**Example**
+```
+N=10 K=5
+```
+
+| -3 | 4 | -2 | 5 | 3 | -2 | 8 | 2 | -1 | 4 |
+| --- | --- | --- | --- | --- | --- | --- | --- | --- |:---:|
+
+**Explanation**
+
+
+
+| s | e | sum |
+| -------- | -------- | -------- |
+| 0 | 4 | 7 |
+| 1 | 5 | 8 |
+| 2 | 6 | 12 |
+| 3 | 7 | 16 |
+| 4 | 8 | 10 |
+| 5 | 9 | 11 |
+
+Maximum: **16**
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Problem 4 : Bruteforce Approach
+
+
+We have to calculate the sum of all subarrays of size k and find the maximum out of them
+
+#### Pseudeocode
+
+```cpp
+function maxSubarrayOfLengthK(A[], N, K) {
+ ans = INT_MIN
+
+ //first window
+ i = 0
+ j = k - 1
+
+ while (j < N) {
+ sum = 0
+ for (idx = start; idx <= end; idx++) {
+ sum += A[idx]
+ }
+ ans = max(sum, ans)
+
+ //going to next subarray of length k
+ i++
+ j++
+ }
+ print(ans)
+
+}
+```
+
+#### Complexity
+
+For what value of k will the iterations be highest ?
+
+
+
+:::warning
+Please take some time to think about the optimised solution approach on your own before reading further.....
+:::
+
+## Problem 4 : Optimized Approach using Prefix Sum Array
+
+
+We can use **Prefix Sum Array** since we have to find sum within a range.
+
+### Pseudeocode
+
+```cpp
+function maxSubarrayOfLengthK(A[], N, K) {
+ // calculate prefix sum array
+ pf[N]
+ pf[0] = A[0]
+ for (idx = 1; idx < N; idx++) {
+ pf[idx] = pf[idx - 1] + A[idx];
+
+ }
+
+ ans = INT_MIN
+ i = 0
+ j = K - 1
+
+ // calculate for each pair of indicies
+ while (j < N) {
+ sum = pf[j] - (i == 0 ? 0 : pf[i - 1])
+
+ ans = max(sum, ans)
+ i++
+ j++
+ }
+ print(ans)
+
+}
+```
+
+
+
+### Question
+
+What is Time Complexity and Space Complexity respectively?
+
+**Choices**
+- [ ] O(N^2) and O(N)
+- [x] O(N) and O(N)
+- [ ] O(N) and O(N^2)
+- [ ] O(1) and O(N)
+
+---
+
+### Problem 4 Optimized Approach : using Sliding Window
+
+
+We want to reduce the space complexity without modifying the given array, but how?
+
+#### Observations
+* We can get sum of next subarray using current subarray sum as follows:-
+ * By adding a new element to current sum.
+ * By subtracting the first element of current subarray.
+
+Given array :-
+| -3 | 4 | -2 | 5 | 3 | -2 | 8 | 2 | -1 | 4 |
+| --- | --- | --- | --- | --- | --- | --- | --- | --- |:---:|
+
+First subarray from 0 to 4:-
+| -3 | 4 | -2 | 5 | 3 |
+| --- | --- | --- | --- | --- |
+
+Converting first to second subarray :-
+
+| ~~-3~~ | 4 | -2 | 5 | 3 | -2 |
+| --- | --- | --- | --- | --- | --- |
+
+Based upon above observation can we say:-
+
+sum of all elements of next subarray = sum of elements of current subarray - first element of current subarray + new element
+
+
+This approach is known as **Sliding window approach**.
+
+#### Dry Run
+
+
+
+**We can clearly observe the window sliding in above run.**
+
+#### Pseudeocode
+
+```cpp
+function maxSubarrayOfLengthK(A[], N, K) {
+ ans = INT_MIN
+ i = 0
+ j = K - 1
+
+ sum = 0 // here k iterations
+ for (int idx = i; idx <= j; idx++) {
+ sum += A[idx]
+ }
+ ans = max(sum, ans)
+
+ j++
+ i++
+
+ while (j < N) {
+ sum = sum + A[j] - A[i - 1]
+
+ ans = max(sum, ans)
+ // here N-k iterations
+ i++
+ j++
+ }
+ print(ans)
+
+}
+
+```
+***Time Complexity : O(N)**
+**Space Complexity : O(1)***
+
+
+
+## Observations for solving problems on Subarrays.
+
+### Observations
+Following are the observations that can be useful when solving problems related to subarrays:
+* Subarrays can be visualized as contiguous part of an array, where the starting and ending indices determine the subarray.
+
+* The total number of subarrays in an array of length n is n*(n+1)/2.
+* To print all possible subarrays, O(n^3) time complexity is required.
+* The sum of all subarrays can be computed in O(n^2) time complexity and O(1) space complexity by using Carry Forward technique.
+* The sum of all subarrays can be computed in O(n^2) time complexity and O(n) space complexity using the prefix sum technique.
+* The number of subarrays containing a particular element arr[i] can be computed in O(n) time complexity and O(1) space complexity using the formula (i+1)*(n-i). This method is called `Contribution Technique`.
+
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays - Carry Forward & Subarrays.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays - Carry Forward & Subarrays.md
new file mode 100644
index 0000000..9200d23
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Arrays - Carry Forward & Subarrays.md
@@ -0,0 +1,400 @@
+# Carry Forward & Subarrays
+
+
+## Problem 1 : Count of Pairs ag
+
+Given a string **s** of lowercase characters, return the **count of pairs (i,j)** such that **i < j** and **s[ i ] is 'a'** and **s[ j ] is 'g'**.
+
+### Example 1
+
+```plaintext
+String s = "abegag"
+Ans = 3
+```
+
+### Explanation:
+Here, [i,j] such that iSince Time complexity of this approach is O(N * Q) then in a case where there are 10^5 elements & 10^5 queries where each query is (L=0 and R=10^5-1) we would encounter **TLE** hence this approach is Inefficient
+
+### Question
+Given the scores of the 10 overs of a cricket match
+2, 8, 14, 29, 31, 49, 65, 79, 88, 97
+How many runs were scored in just 7th over?
+
+**Choices**
+- [x] 16
+- [ ] 20
+- [ ] 18
+- [ ] 17
+
+Total runs scored in over 7th : 65 - 49 = 16
+(score[7]-score[6])
+
+
+
+### Question
+Given the scores of the 10 overs of a cricket match
+2, 8, 14, 29, 31, 49, 65, 79, 88, 97
+How many runs were scored from 6th to 10th over(both included)?
+
+**Choices**
+- [x] 66
+- [ ] 72
+- [ ] 68
+- [ ] 90
+
+
+Total runs scored in over 6th to 10th : 97 - 31 = 66
+(score[10]-score[5])
+
+### Question
+Given the scores of the 10 overs of a cricket match
+2, 8, 14, 29, 31, 49, 65, 79, 88, 97
+How many runs were scored in just 10th over?
+
+**Choices**
+
+- [ ] 7
+- [ ] 8
+- [x] 9
+- [ ] 10
+
+
+Total runs scored in over 6th to 10th : 97 - 88 = 9
+(score[10]-score[9])
+
+
+
+
+### Question
+Given the scores of the 10 overs of a cricket match
+2, 8, 14, 29, 31, 49, 65, 79, 88, 97
+How many runs were scored from 3rd to 6th over(both included)?
+
+**Choices**
+
+- [ ] 70
+- [ ] 40
+- [ ] 9
+- [x] 41
+
+Total runs scored in over 3rd to 6th : 49-8 = 41
+(score[6]-score[2])
+
+### Question
+Given the scores of the 10 overs of a cricket match
+2, 8, 14, 29, 31, 49, 65, 79, 88, 97
+How many runs were scored from 4th to 9th over(both included)?
+
+**Choices**
+
+- [ ] 75
+- [ ] 80
+- [x] 74
+- [ ] 10
+
+
+Total runs scored in over 4th to 9th : 88 - 14 = 74
+(score[9]-score[3])
+
+:::success
+What do you observe from above cricket example ? Take some time and think about it....
+:::
+
+### Observation for Optimised Solution
+
+#### Observation
+* On observing cricket board score, we can say that queries can be answered in just constant time since we have cummulative scores.
+
+* In the similar manner, if we have cummulative sum array for the above problem, we should be able to answer it in just constant time.
+
+* We need to create cumulative sum or prefix sum array for above problem.
+
+
+
+## How to create Prefix Sum Array ?
+
+### Definition
+
+pf[i] = sum of all elements from 0 till ith index.
+
+
+
+### Example
+Step1:-
+Provided the intial array:-
+| 2 | 5 | -1 | 7 | 1 |
+| --- | --- | --- | --- | --- |
+
+We'll create prefix sum array of size 5 i.e. size equal to intial array.
+`Initialise pf[0] = initialArray[0]`
+
+| 2 | - | - | - | - |
+| --- | --- | --- | --- | --- |
+
+| 2 | 7 | - | - | - |
+| --- | --- | --- | --- | --- |
+
+| 2 | 7 | 6 | - | - |
+| --- | --- | --- | --- | --- |
+
+| 2 | 7 | 6 | 13 | - |
+| --- | --- | --- | --- | --- |
+
+| 2 | 7 | 6 | 13 | 14 |
+| --- | --- | --- | --- | --- |
+
+
+Finally we have the prefix sum array :-
+
+| 2 | 7 | 6 | 13 | 14 |
+| --- | --- | --- | --- | --- |
+
+
+
+### Question
+Calculate the prefix sum array for following array:-
+
+| 10 | 32 | 6 | 12 | 20 | 1 |
+| --- | --- | --- | --- | --- |:---:|
+
+**Choices**
+- [x] `[10,42,48,60,80,81]`
+- [ ] `[10,42,49,60,79,81]`
+- [ ] `[42,48,60,80,81,10]`
+- [ ] `[15,43,58,61,70,82]`
+
+### Brute Force Code to create Prefix Sum Array and observation for Optimisation
+
+
+```cpp
+pf[N]
+for (i = 0; i < N; i++) {
+
+ sum = 0;
+
+ for (int j = 0; j <= i; j++) {
+ sum = sum + A[j]
+ }
+
+ pf[i] = sum;
+}
+```
+
+
+
+## Observation for Optimising Prefix Sum array calculations
+
+pf[0] = A[0]
+pf[1] = A[0] + A[1]
+pf[2] = A[0] + A[1] + A[2]
+pf[3] = A[0] + A[1] + A[2] + A[3]
+pf[4] = A[0] + A[1] + A[2] + A[3] + A[4]
+
+* Can we observe that we are making redundant calculations?
+
+* We could utilise the previous sum value.
+ * pf[0] = A[0]
+ * pf[1] = pf[0] + A[1]
+ * pf[2] = pf[1] + A[2]
+ * pf[3] = pf[2] + A[3]
+ * pf[4] = pf[3] + A[4]
+
+* **Generalised Equation is:** ```pf[i] = pf[i-1] + A[i]```
+
+## Optimised Code:
+
+```cpp
+pf[N]
+pf[0] = A[0];
+for (i = 1; i < N; i++) {
+ pf[i] = pf[i - 1] + A[i];
+}
+```
+* Time Complexity: O(N)
+
+### How to answer the Queries ?
+
+:::success
+Now that we have created prefix sum array...finally how can we answer the queries ? Let's think for a while...
+:::
+
+A[ ] = [-3, 6, 2, 4, 5, 2, 8, -9, 3, 1]
+
+pf[ ] =[-3, 3, 5, 9, 14, 16, 24, 15, 18, 19]
+
+| L | R | Solution | |
+| -------- | -------- | -------- | -------- |
+| 4 | 8 | pf[8] - pf[3] | 18 - 9 = 9 |
+| 3 | 7 | pf[7] - pf[2] |15 - 5 = 10 |
+| 1 | 3 | pf[3] - pf[0] |9 - (-3) = 12 |
+| 0 | 4 | pf[4] |14 |
+| 7 | 7 | pf[7] - pf[6] |15 - 24 = -9 |
+
+
+
+### Generalised Equation to find Sum:
+
+sum[L R] = pf[R] - pf[L-1]
+
+Note: if L==0, then sum[L R] = pf[R]
+
+
+### Complete code for finding sum of queries using Prefix Sum array:
+
+```cpp
+Function querySum(Queries[][], Array[], querySize, size) {
+ //calculate pf array
+ pf[N]
+ pf[0] = A[0];
+ for (i = 1; i < N; i++) {
+ pf[i] = pf[i - 1] + A[i];
+ }
+
+ //answer queries
+ for (i = 0; i < Queries.length; i++) {
+ L = Queries[i][0];
+ R = Queries[i][1];
+
+ if (L == 0) {
+ sum = pf[R]
+ } else {
+ sum = pf[R] - pf[L - 1];
+ }
+
+ print(sum);
+ }
+}
+```
+***Time Complexity : O(N+Q)**
+**Space Complexity : O(N)***
+
+
+
+### Space Complexity can be further optimised if you modify the given array.
+
+```cpp
+Function prefixSumArrayInplace(Array[], size) {
+ for (i = 1; i < size; i++) {
+ Array[i] = Array[i - 1] + Array[i];
+ }
+}
+```
+***Time Complexity : O(N)**
+**Space Complexity : O(1)***
+
+### Problem 1 : Sum of even indexed elements
+
+Given an array of size N and Q queries with start (s) and end (e) index. For every query, return the sum of all **even indexed elements** from **s to e**.
+
+**Example**
+
+```plaintext
+A[ ] = { 2, 3, 1, 6, 4, 5 }
+Query :
+ 1 3
+ 2 5
+ 0 4
+ 3 3
+
+Ans:
+ 1
+ 5
+ 7
+ 0
+```
+### Explanation:
+* From index 1 to 3, sum: A[2] = 1
+* From index 2 to 5, sum: A[2]+A[4] = 5
+* From index 0 to 4, sum: A[0]+A[2]+A[4] = 7
+* From index 3 to 3, sum: 0
+
+### Brute Force
+How many of you can solve it in $O(N*Q)$ complexity?
+**Idea:** For every query, Iterate over the array and generate the answer.
+
+:::warning
+Please take some time to think about the Optimised approach on your own before reading further.....
+:::
+
+### Problem 1 : Observation for Optimisation
+
+
+Whenever range sum query is present, we should think in direction of **Prefix Sum**.
+
+**Hint 1:** Should we find prefix sum of entire array?
+**Expected:** No, it should be only for even indexed elements.
+
+**We can assume that elements at odd indices are 0 and then create the prefix sum array.**
+
+
+Consider this example:-
+
+```
+ A[] = 2 3 1 6 4 5
+PSe[] = 2 2 3 3 7 7
+```
+
+> Note: PSe[i] denotes sum of all even indexed elements from 0 to ith index.
+
+
+If **i is even** we will use the following equation :-
+
+ PSe[i] = PSe[i-1] + A[i]
+
+
+If **i is odd** we will use the following equation :-
+
+ PSe[i] = PSe[i-1]
+
+
+
+### Question
+Construct the Prefix Sum for even indexed elements for the given array
+[2, 4, 3, 1, 5]
+
+**Choices**
+- [ ] 1, 6, 9, 10, 15
+- [x] 2, 2, 5, 5, 10
+- [ ] 0, 4, 4, 5, 5
+- [ ] 0, 4, 7, 8, 8
+
+
+
+We will assume elements at odd indices to be 0 and create a prefix sum array taking this assumption.
+So ```2 2 5 5 10``` will be the answer.
+
+
+### Problem 1 : Pseudocode
+
+
+```cpp
+void sum_of_even_indexed(int A[], int queries[][], int N) {
+ // prefix sum for even indexed elements
+ int PSe[N];
+
+ if (A[0] % 2 == 0) PSe[0] = A[0];
+ else PSe[0] = 0;
+
+ for (int i = 0; i < N; i++) {
+ if (i % 2 == 0) {
+ PSe[i] = PSe[i - 1] + A[i];
+ } else {
+ PSe[i] = PSe[i - 1];
+ }
+ }
+ for (int i = 0; i < queries.size(); i++) {
+ s = queries[i][0]
+ e = queries[i][1]
+ if (s == 0) {
+ print(PSe[e])
+ } else {
+ print(PSe[e] - PSe[s - 1])
+ }
+
+ }
+
+}
+```
+### Complexity
+-- TC - $O(n)$
+-- SC - $O(n)$
+
+### Problem 1 Extension : Sum of all odd indexed elements
+
+
+
+If we have to calculate the sum of all ODD indexed elements from index **s** to **e**, then Prefix Sum array will be created as follows -
+
+> if i is odd
+
+ PSo[i] = PSo[i-1] + array[i]
+
+
+> and if i is even :-
+
+ PSo[i] = PSo[i-1]
+
+
+### Problem 2 : Special Index
+
+Given an array of size N, count the number of special index in the array.
+**Note:** **Special Indices** are those after removing which, sum of all **EVEN** indexed elements is equal to sum of all **ODD** indexed elements.
+
+**Example**
+
+```plaintext
+A[ ] = { 4, 3, 2, 7, 6, -2 }
+Ans = 2
+```
+
+We can see that after removing 0th and 2nd index **Se** and **So** are equal.
+
+| i | A[i] | Se | So |
+| --- |------------------| ----- | ----- |
+| 0 | { 3, 2, 7, 6, -2 } | 8 | 8 |
+| 1 | { 4, 2, 7, 6, -2 } | 9 | 8 |
+| 2 | { 4, 3, 7, 6, -2 } | 9 | 9 |
+| 3 | { 4, 3, 2, 6, -2 } | 4 | 9 |
+| 4 | { 4, 3, 2, 7, -2 } | 4 | 10 |
+| 5 | { 4, 3, 2, 7, 6 } | 12 | 10 |
+
+**Note: Please keep a pen and paper with you for solving quizzes.**
+
+
+
+### Question
+What will be the sum of elements at **ODD indices** in the resulting array after removal of **index 2** ?
+A[ ] = [ 4, 1, 3, 7, 10 ]
+
+**Choices**
+- [ ] 8
+- [ ] 14
+- [x] 11
+- [ ] 9
+
+
+After removal of element at **index 2**, elements after index 2 has changed their positions:
+Sum of elements at **ODD** indices from **[0 to 1]** + Sum of elements at **EVEN** indices from **[3 to 4]** =
+ 1 + 10 = 11
+
+
+
+### Question
+What will be the sum of elements at **ODD indices** in the resulting array after removal of **index 3** ?
+A[ ] = { 2, 3, 1, 4, 0, -1, 2, -2, 10, 8 }
+
+**Choices**
+- [ ] 8
+- [x] 15
+- [ ] 12
+- [ ] 21
+
+
+**Explanation:**
+
+After removal of element at index 3, elements after index 3 has changed their positions:
+Sum of elements at **ODD** indices from **[0 to 2]** index + Sum of elements at **EVEN** indices from **[4 to 9]** = A[1]+A[4]+A[6]+A[8] = **3+0+2+10 = 15**
+
+
+
+
+### Question
+What will be the sum of elements at EVEN indices in the resulting array after removal of index 3 ?
+[2, 3, 1, 4, 0, -1, 2, -2, 10, 8]
+
+**Choices**
+- [ ] 15
+- [x] 8
+- [ ] 10
+- [ ] 12
+
+
+
+After removal of element at index 3, elements are after index 3 has changed their positions:
+Sum of elements at **EVEN** indices from **[0 to 2]** index + Sum of elements at **ODD** indices from **[4 to 9]** = A[0]+A[2]+A[5]+A[7]+A[9] = 2+1+(-1)+(-2)+8 = 8
+
+:::warning
+Please take some time to think about the optimised solution approach on your own before reading further.....
+:::
+
+### Problem 2 : Observation for Optimised Approach
+
+
+* Suppose, we want to check if **i** is a **Special Index**.
+* Indices of elements present on the left side of i will remain intact while indices of elements present on the right side of element i will get changed.
+* Elements which were placed on odd indices will shift on even indices and vice versa.
+
+For example:
+```plaintext
+A[ ] = { 2, 3, 1, 4, 0, -1, 2, -2, 10, 8 }
+```
+Sum of **ODD** indexed elements after removing element at index 3 =
+
+
+
+Sum of **EVEN** indexed elements after removing element at index 3 =
+
+
+
+
+### Approach
+* Create **Prefix Sum** arrays for **ODD** and **EVEN** indexed elements.
+* Run a loop for $i$ from 0 to n – 1, where n is the size of the array.
+* For every element check whether **So** is equal to **Se** or not using the above equations.
+* Increment the count if Se is equal to So.
+
+**NOTE:** Handle the case of $i=0$.
+### Pseudocode
+```cpp
+int count_special_index(int arr[], int n) {
+ // prefix sum for even indexed elements
+ int PSe[n];
+ // prefix sum for odd indexed elements
+ int PSo[n];
+
+ //Say we have already calculated PSe and PSo
+
+ //Code to find Special Indices
+
+ int count = 0;
+ for (int i = 0; i < n; i++) {
+
+ int Se, So;
+
+ if (i == 0) {
+ Se = PSo[n - 1] - PSo[i]; //sum from [i+1 n-1]
+ So = PSe[n - 1] - PSe[i]; //sum from [i+1 n-1]
+ } else {
+ Se = PSe[i - 1] + PSo[n - 1] - PSo[i]; //sum even from [0 to i-1] and odd from [i+1 n-1]
+ So = PSo[i - 1] + PSe[n - 1] - PSe[i]; //sum odd from [0 to i] and even from [i+1 n-1]
+ }
+
+ if (Se == So) {
+ count++;
+ }
+
+ }
+
+ return count;
+}
+```
+
+### Complexity
+
+-- TC - $O(n)$
+-- SC - $O(n)$
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Bit Manipulations Basics.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Bit Manipulations Basics.md
new file mode 100644
index 0000000..c425753
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Bit Manipulations Basics.md
@@ -0,0 +1,484 @@
+
+# Bit Manipulation Basics
+
+## Decimal Number System
+* The decimal system, also known as the base-10 system, is the number system we use in our everyday lives.
+* It is called base-10 because a single digit can take 10 values from 0 to 9.
+
+The position of each digit in a decimal number represents a different power of 10.
+
+For example,
+```cpp
+342 = 300 + 40 + 2 = 3*10^2 + 4*10^1 + 2*10^0
+```
+```cpp
+2563 = 2000 + 500 + 60 + 3 = 2*10^3 + 5*10^2 + 6*10^1 + 3*10^0
+```
+
+---
+## Binary Number System
+* The binary system, also known as the base-2 system, is used in digital electronics and computing.
+* It has only two digits, which are 0 and 1.
+
+In the binary system, each digit represents a different power of 2.
+
+For example,
+```cpp
+110 = 1*2^2 + 1*2^1 + 0*2^0 = 4 + 2 + 0 = 6
+```
+```cpp
+1011 = 1*2^3 + 0*2^2 1*2^1 + 1*2^0 = 8 + 0 + 2 + 1 = 11
+```
+
+---
+### Binary to Decimal Conversion
+For this conversion, we need to multiply each digit of the binary number by the corresponding power of 2, and then add up the results.
+
+**Example 1:**
+Convert binary number 1101 to decimal number.
+
+```
+Starting from the rightmost digit, we have:
+
+1 * 2^0 = 1
+0 * 2^1 = 0
+1 * 2^2 = 4
+1 * 2^3 = 8
+
+Adding up the results, we get:
+
+1 + 0 + 4 + 8 = 13
+
+Therefore, the decimal equivalent of the binary number 1101 is 13.
+```
+
+**Example 2:**
+Convert binary number 10101 to decimal number.
+
+- Starting from the rightmost digit, we have:
+```
+1 * 2^0 = 1
+0 * 2^1 = 0
+1 * 2^2 = 4
+0 * 2^3 = 0
+1 * 2^4 = 16
+```
+- Adding up the results, we get:
+
+```
+1 + 0 + 4 + 0 + 16 = 21
+```
+
+Therefore, the decimal equivalent of the binary number 10101 is 21.
+
+---
+### Question
+What is the decimal representation of this binary number: 1011010
+
+**Choices**
+
+- [ ] 45
+- [x] 90
+- [ ] 94
+- [ ] 130
+
+
+**Explanation:**
+
+Starting from the rightmost digit, we have:
+0 * 2^0 = 0
+1 * 2^1 = 2
+0 * 2^2 = 0
+1 * 2^3 = 8
+1 * 2^4 = 16
+0 * 2^5 = 0
+1 * 2^6 = 64
+Adding up the results, we get: 0 + 2 + 0 + 8 + 16 + 0 + 64 = 90
+Therefore, the decimal representation of the binary number 1011010 is 90.
+
+---
+### Decimal to Binary Conversion
+We can solve it using long division method, for which we need to repeatedly divide the decimal number by 2 and record the remainder until the quotient becomes 0.
+
+**Example:**
+Convert decimal number 20 to binary number.
+
+
+
+---
+### Question
+
+What is the binary representation of 45 ?
+
+**Choices**
+
+- [ ] 101100
+- [ ] 101110
+- [ ] 101111
+- [x] 101101
+
+
+**Explanation:** Here are the steps to convert decimal number 45 to binary:
+
+
+---
+### Addition of Decimal Numbers
+**Example -**
+```cpp
+Calculate => (368 + 253)
+```
+
+
+**Explanation:**
+
+* Start by adding the rightmost digits: 8 + 3 = 11 (digit = 11%10 = 1, carry 11/10 = 1)
+* Next column: 1 + 6 + 5 = 12 (digit = 12%10 = 2, carry 12/10 = 1)
+* Final column: 1 + 3 + 4 = 8 (digit = 8%10 = 8, carry 8/10 = 0)
+
+Therefore, answer is 821.
+
+---
+
+### Addition of Binary Numbers
+**Example 1:**
+
+| | 1 | 0 | 1 | 0 | 1 |
+|---|---|---|---|---|---|
+| + | | 1 | 1 | 0 | 1 |
+| 1 | 0 | 0 | 0 | 1 | 0 |
+
+**Explanation:**
+d = answer digit, c = carry
+* From right, 1 + 1 = 2 (d = 2%2=0, c = 2/2 = 1)
+* Next: 1 + 0 + 0 = 1 (d = 1%2=1, c = 1/2 = 0)
+* Next: 0 + 1 + 1 = 2 (d = 2%2=0, c = 2/2 = 1)
+* Next: 1 + 0 + 1= 2 (d = 2%2=0, c = 2/2 = 1)
+* Final: 1 + 1 = 2 (d = 2%2=0, c = 2/2 = 1)
+* Finally, 1 carry is remaining, so write 1.
+
+The result is 100010 in binary.
+
+
+
+**Example 2:**
+
+| | 1 | 1 | 0 | 1 | 0 | 1 |
+|---|---|---|---|---|---|---|
+| + | 1 | 0 | 0 | 1 | 1 | 0 |
+| 1 | 0 | 1 | 1 | 0 | 1 | 1 |
+
+**Explanation:**
+d = answer digit, c = carry
+* From Right: 1 + 0 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+* Next column: 0 + 0 + 1 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+* Next column: 0 + 1 + 1 = 2 (d: 2%2 = 0, c: 2/2 = 1)
+* Next column: 1 + 0 + 0 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+* Next column: 0 + 1 + 0 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+* Next column: 0 + 1 + 1 = 2 (d: 2%2 = 0, c: 2/2 = 1)
+* Finally, 1 carry is remaining, so write 1.
+
+The result is 1011011 in binary.
+
+
+---
+### Question
+
+What is the sum of these binary numbers: 10110 + 00111
+
+**Choices**
+- [ ] 11111
+- [ ] 10101
+- [ ] 11011
+- [x] 11101
+
+
+**Explanation:**
+d = answer digit, c = carry
+* Start by adding the rightmost bits: 0 + 1 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+* Next column: 0 + 1 + 1 = 2 (d: 2%2 = 0, c: 2/2 = 1)
+* Next column: 1 + 1 + 1 = 3 (d: 3%2 = 1, c: 3/2 = 1)
+* Next column: 1 + 0 + 0 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+* Final column: 0 + 1 + 0 = 1 (d: 1%2 = 1, c: 1/2 = 0)
+
+The result is 11101 in binary.
+
+---
+
+### Bitwise Operators
+* Bitwise operators are used to perform operations on individual bits of binary numbers.
+* They are often used in computer programming to manipulate binary data.
+* In bitwise operations, `0 -> false/unset` and `1 -> true/set`
+
+#### AND (&)
+* This operator takes two binary numbers and performs a logical AND operation on each pair of corresponding bits.
+* The resulting bit in the output is 1 if and only if both the corresponding bits in the input are 1. Otherwise, the resulting bit is 0.
+* The symbol for AND operator is '&'.
+``` cpp
+0 & 0 = 0
+1 & 0 = 0
+0 & 1 = 0
+1 & 1 = 1
+```
+#### OR (|)
+* This operator takes two binary numbers and performs a logical OR operation on each pair of corresponding bits.
+* The resulting bit in the output is 1 if either one or both of the corresponding bits in the input are 1. Otherwise, the resulting bit is 0.
+* The symbol for OR operator is '|'.
+``` cpp
+0 | 0 = 0
+1 | 0 = 1
+0 | 1 = 1
+1 | 1 = 1
+```
+#### XOR (^)
+* This operator takes two binary numbers and performs a logical XOR (exclusive OR) operation on each pair of corresponding bits.
+* The resulting bit in the output is 1 if the corresponding bits in the input are different. Otherwise, the resulting bit is 0.
+* The symbol for XOR operator is '^'.
+``` cpp
+0 ^ 0 = 0
+1 ^ 0 = 1
+0 ^ 1 = 1
+1 ^ 1 = 0
+```
+#### NOT(!/~)
+* This operator takes a single binary number and performs a logical NOT operation on each bit.
+* The resulting bit in the output is the opposite of the corresponding bit in the input.
+* The symbols for NOT operator are '~' or '!'.
+``` cpp
+~0 = 1
+~1 = 0
+```
+---
+### Bitwise Operations Example
+
+**Example 1:**
+```cpp
+5 & 6
+//Binary representation
+5 -> 101
+6 -> 110
+// Bitwise AND operation
+101 & 110 = 100 = 4
+```
+
+**Example 2:**
+```cpp
+20 & 45
+//Binary representation
+20 -> 010100
+45 -> 101101
+// Bitwise AND operation
+010100 & 101101 = 111101 = 61
+```
+**Example 3:**
+```cpp
+92 & 154
+//Binary representation
+92 -> 01011100
+154 -> 10011010
+// Bitwise OR operation
+01011100 | 10011010 = 11011110 = 222
+```
+**Example 4**:
+```cpp
+~01011100
+//Binary representation
+92 -> 01011100
+// Bitwise NOT operation
+~01011100 = 10100011 = 163
+```
+**Example 5:**
+```cpp
+92 ^ 154
+//Binary representation
+92 -> 01011100
+154 -> 10011010
+// Bitwise XOR operation
+01011100 ^ 10011010 = 11000110 = 198
+```
+
+---
+### Question
+
+What is the value of A ^ B (i.e. A XOR B) where, A = 20 and B = 45?
+
+**Choices**
+
+- [ ] 4
+- [ ] 20
+- [x] 57
+- [ ] 61
+
+
+**Explanation:**
+* A = 20 = 00010100 (in binary)
+* B = 45 = 00101101 (in binary)
+
+Performing XOR on each pair of bits, we get:
+```
+00010100 ^ 00101101 = 00111001
+```
+
+Therefore, the value of A XOR B is 00111001, which is 57 in decimal format.
+
+---
+### Binary Representation of Negative numbers
+
+To convert a negative number to its binary representation, we can use two's complement representation.
+
+It works as follows -
+
+* Convert the absolute value of number to Binary representation.
+* Invert all the bits of number obtained in step 1.
+* Add 1 to the number obtained in step 2.
+
+Example of converting the negative number $-5$ to its $8-bit$ binary representation:
+1. 5 to binary representation:```0000 0101```
+2. Invert all the bits:`0000 0101 -> 1111 1010`
+3. Add 1 to the inverted binary representation:
+`1111 1010 + 0000 0001 = 1111 1011`
+
+**Note:**
+1. The MSB has a negative base and that is where the negative sign comes from.
+2. In case of positive number, MSB is always 0 and in case of negative number, MSB is 1.
+
+---
+### Question
+
+What is the binary representation of -3 in 8-bit signed integer format?
+Choose the correct answer
+
+**Choices**
+
+- [x] 11111101
+- [ ] 01111101
+- [ ] 00000011
+- [ ] 10101010
+
+---
+### Question
+What is the binary representation of -10 in 8-bit signed integer format?
+Choose the correct answer
+
+**Choices**
+
+- [x] 11110110
+- [ ] 11110111
+- [ ] 11111110
+- [ ] 10101010
+
+---
+
+
+### Range of Data Types
+What is the minimum & maximum no. that can be stored in the given no. of bits?
+
+
+
+Generalisation for N Bits:
+
+
+
+So, in general we can say that the {minimum,maximum} number in n-bit number is **{-2N-1 , 2N-1-1}**.
+
+#### Integer(32-bit number)
+Integer is the 32 bit number. Its range is **{-232-1 , 232-1-1}**.
+#### Long(64-bit number)
+Long is the 64 bit number. Its range is **{-264-1 , 264-1-1}**.
+
+### Approximation
+Approximation is done to better approximate the range of values that can be stored in integer or long.
+
+For integer,
+
+
+
+For long,
+
+
+
+
+---
+
+### Importance of Constraints
+Let's understand the importance of constraints using example.
+Suppose we have two integers as
+```
+a = 10^5
+b = 10^6
+```
+What will be the value of c ?
+
+#### TRY 1:
+```
+int c = a*b
+```
+It will Overflow, i.e **c** will contain wrong value.
+
+**Fails, the Reason:**
+* The calculation happens at ALU.
+* If we provide ALU with two INT, it calculates result in INT.
+* Therefore, $a*b$ will overflow before even getting stored in c.
+
+
+
+#### TRY 2:
+
+Say, we change the data type of c to long, what will be the value of c?
+```
+long c = a*b
+```
+**Fails, the Reason:**
+**c** would contain overflowed value since $a*b$ will overflow at the time of calculation, therefore there's no use to change datatype of **c** from INT to LONG.
+
+
+
+#### TRY 3:
+What if we typecast $a*b$ to long as below?
+
+```
+long c = long (a*b)
+```
+
+**Fails, the Reason:**
+Already overflown, hence no use to typecast later.
+
+
+
+#### TRY 4:
+What if we change the equation as shown below?
+```
+long c = (long) a * b
+```
+This is the correct way to store.
+
+**WORKS, the Reason:**
+* Here, we have typecasted **a** to long before multiplying with **b**.
+* If we send one INT and one LONG, ALU calculates answer in LONG.
+
+
+
+### Question
+
+Given an array of size N, calculate the sum of array elements.
+**Constraints:**
+1 <= N <= 105
+1 <= A[i] <= 106
+
+Is the following code correct ?
+
+```
+int sum = 0;
+for (int i = 0; i < N; i++) {
+ sum = sum + A[i];
+}
+print(sum)
+```
+
+**We should look at constraints.**
+As per constraint, range of sum will be as follows -
+**1 <= sum <= 1011**
+
+The above code is incorrect since sum can be as big as 1011 which can't be stored in INTEGER.
+Hence, we should change dataType of "sum" to LONG.
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Interview Problems.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Interview Problems.md
new file mode 100644
index 0000000..b504a71
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Interview Problems.md
@@ -0,0 +1,541 @@
+# Interview Problems
+
+## Analyzing constraints
+
+### Tips on Problem Constraints
+* Analyzing the constraints can help you determine which time complexity and data structure or algorithm to use for a given problem.
+* It is important to look at the constraints whenever we are solving a problem.
+
+Note: In Interviews, don't ask the constraints directly. Rather, tell your approach and ask the interviewer if you need to optimize further.
+
+If,
+
+| Constraint | Possible Time Complexities |
+| ----------------------- | ------------------------------ |
+| n <= 10^6 | O(n), O(nlogn) |
+| n <= 20 | O(n!), O(2^n) |
+| n <= 10^10 | O(logn), O(sqrt(n)) |
+
+Note: These are just general guidelines. The actual time complexity can vary based on the specific problem and implementation.
+
+It's always important to analyze the problem and determine the best approach for your specific solution.
+
+---
+### Problem 1 Find the maximum number of consecutive 1's after replacement
+
+#### Problem Statement
+Given an array of 1's and 0's, you are allowed to replace only one 0 with 1. Find the maximum number of consecutive 1's that can be obtained after making the replacement.
+
+**Example 1**
+```cpp
+Input = [1, 1, 0, 1, 1, 0, 1, 1]
+Output = 5
+```
+**Explanation:**
+If we replace 0 at 2nd index or 0 at 5th index with 1, in both cases we get 5 consecutes 1's.
+
+
+### Question
+Find the maximum number of consecutive 1's that can be obtained after replacing only one 0 with 1.
+A[] = [ 1, 1, 0, 1, 1, 0, 1, 1, 1 ]
+
+**Choices**
+- [ ] 4
+- [ ] 5
+- [x] 6
+- [ ] 7
+
+
+* If we replace 0 at 2nd index with 1 we get 5 consecutes 1's.
+* If we replace 0 at 5th index with 1 we get 6 consecutes 1's.
+
+Hence, the maximum is 6 consecutive 1's.
+
+---
+### Question
+Find the maximum number of consecutive 1's that can be obtained after replacing only one 0 with 1.
+A[] = [0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0]
+
+**Choices**
+- [ ] 4
+- [ ] 5
+- [x] 6
+- [ ] 7
+
+* If we replace 0 at 0th index with 1 we get 4 consecutes 1's.
+* If we replace 0 at 4th index with 1 we get 6 consecutes 1's.
+* If we replace 0 at 7th index with 1 we get 5 consecutes 1's.
+* If we replace 0 at last index with 1 we get 3 consecutes 1's.
+
+Hence, the maximum is 6 consecutive 1's.
+
+---
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Solution Approach
+* Maintain a variable say "ans", which keeps track of the maximum consecutive 1's encountered.
+* Initialize it with 0.
+* Iterate through the input array. When we encounter a zero at an index, we do the following:
+ * Count no. of consecutive 1's on left: **l**
+ * Count no. of consecutive 1's on right: **r**
+ * If (**l+r+1** > ans), replace ans with (**l+r+1**).
+
+**Edge case**: When all the array elements are `1's`, then return the length of the whole array.
+
+#### Pseudocode
+```cpp
+int findMaxConsecutiveOnes(int nums[]) {
+ int n = nums.size();
+ int maxCount = 0;
+ int totalOnes = 0;
+
+ for (int i = 0; i < n; i++) {
+ if (nums[i] == 1)
+ totalOnes++;
+ }
+
+ if (totalOnes == n)
+ return n;
+
+ for (int i = 0; i < n; i++) {
+ if (nums[i] == 0) {
+ int l = 0, r = 0, j = i + 1;
+ // calculate the maximum consecutive ones after replacing this zero
+ while (j < n && nums[j] == 1) {
+ r++;
+ j++;
+ }
+ j = i - 1;
+ while (j >= 0 && nums[j] == 1) {
+ l++;
+ j--;
+ }
+ maxCount = max(l + r + 1, count);
+ }
+ }
+
+ return maxCount;
+}
+```
+---
+### Question
+What will be the TC of this approach ?
+
+**Choices**
+- [x] O(n)
+- [ ] O(n^2)
+- [ ] O(n^3)
+- [ ] O(n^4)
+
+**Explanation:**
+The time complexity of the above solution is O(n) because it performs a single pass over the input array and every element will get accessed at maximum of 3 times.
+
+> 
+
+
+---
+## Variation of Problem 1
+### Coding Question 2
+#### Problem Statement
+Given an array of 1's and 0's, find the maximum number of consecutive 1's that can be obtained by SWAPPING at most one 0 with 1(already present in the string).
+
+
+**Example 1**
+```cpp
+Input: [1, 0, 1, 1, 0, 1]
+Output: 5
+```
+#### Explanation:
+We can swap zero at index 4 with 1 to get the array [1, 0, 1, 1, 1, 1], which has 5 consecutive 1s.
+
+---
+
+### Question
+find the maximum number of consecutive 1’s that can be obtained by swapping at most one 0 with 1.
+A[] = [1, 1, 0, 1, 1, 1]
+
+**Choices**
+- [ ] 2
+- [ ] 4
+- [x] 5
+- [ ] 6
+
+**Explanation:**
+We can swap the zero at index 2 with 1 at either index 0 or index 5 to get the array which has 5 consecutive 1s.
+
+---
+### Problem 1 variation continues
+
+#### Solution
+* The solution is very similar to solution to previous problem except for some modifications.
+* We iterate through the input array. When we encounter a zero at an index, we do the following:
+ * Count no. of consecutive 1's on left -> l.
+ * Count no. of consecutive 1's on right -> r.
+ * If (l+r) is equal to total no. of 1's in the array, then currMax = (l+r), else currMax = (l+r+1).
+ * If (currMax > ans), replace ans with (currMax)
+
+**Edge case**: When all the array elements are `1's`, then return the length of the whole array.
+
+#### Pseudocode
+```cpp
+int findMaxConsecutiveOnes(int nums[]) {
+ int n = nums.size();
+ int maxCount = 0;
+ int totalOnes = 0;
+
+ for (int i = 0; i < n; i++) {
+ if (nums[i] == 1)
+ totalOnes++;
+ }
+
+ if (totalOnes == n)
+ return n;
+
+ for (int i = 0; i < n; i++) {
+ if (nums[i] == 0) {
+ int l = 0, r = 0, j = i + 1, currMax;
+ // calculate the maximum consecutive ones after swapping this zero
+ while (j < n && nums[j] == 1) {
+ r++;
+ j++;
+ }
+ j = i - 1;
+ while (j >= 0 && nums[j] == 1) {
+ l++;
+ j--;
+ }
+ if (l + r == totalOnes)
+ currMax = l + r;
+ else
+ currMax = l + r + 1
+ maxCount = max(currMax, count);
+ }
+ }
+
+ return maxCount;
+}
+```
+#### Time and Space Complexity
+* TC - O(n)
+* SC - O(1)
+
+---
+### Problem 2 Majority Element
+
+
+Given an array of N integers, find the **majority element.**
+
+The **majority element** is the element that occurs more than n/2 times where n is size of the array.
+
+
+**Example 1**
+
+```plaintext
+A[ ] = { 2, 1, 4 }
+Ans = No Majority element
+```
+### Explanation
+
+Here, none of the elements have frequency more than n/2 where n is 3.
+
+
+
+
+**Example 2**
+
+```plaintext
+A[ ] = { 3, 4, 3, 2, 4, 4, 4, 4}
+Ans = 4
+```
+#### Explanation
+Here, frequency of 4 is more than n/2 that is 5 where n is 8. So 4 will be the majority element.
+
+
+**Example 3**
+
+```plaintext
+A[ ] = { 3, 3, 4, 2, 4, 4, 2, 4}
+Ans = No Majority element
+```
+#### Explanation:
+Here, none of the elements have frequency more than n/2 where n is 8.
+
+
+---
+### Question
+What is the majority element in this array?
+3, 4, 3, 6, 1, 3, 2, 5, 3, 3, 3
+
+**Choices**
+- [ ] 1
+- [x] 3
+- [ ] 2
+- [ ] 6
+
+
+Here, 3 has frequency > n/2 where n is 11.
+
+### Question
+What is the majority element in the following array?
+4, 6, 5, 3, 4, 5, 6, 4, 4, 4
+
+**Choices**
+- [ ] 3
+- [ ] 4
+- [ ] 6
+- [x] No Majority Element
+
+
+**Explanation:**
+Here, none of the elements have frequency more than n/2 where n is 10.
+
+---
+### Question
+At max how many majority elements can be there in an array?
+
+**Choices**
+- [x] 1
+- [ ] 2
+- [ ] n-1
+- [ ] n
+
+
+Suppose there is an array of size n. If frequency of an element is greater than n/2, then there cannot exist an element in remaining elements whose frequency is greater than n/2 .
+Hence, there can be only one majority element.
+
+
+---
+### Problem 2 Brute Force
+
+Iterate through every element in the array, count the number of times each element appears, and return the element that appears more than n/2 times.
+
+
+#### Pseudocode
+```cpp
+void findMajority(int arr[], int n) {
+ int maxCount = 0;
+ int index = -1;
+ for (int i = 0; i < n; i++) {
+ int count = 0;
+ for (int j = 0; j < n; j++) {
+ if (arr[i] == arr[j])
+ count++;
+ }
+
+ if (count > maxCount) {
+ maxCount = count;
+ index = i;
+ }
+ }
+
+ if (maxCount > n / 2)
+ print(arr[index])
+
+ else
+ print("No Majority Element")
+}
+```
+
+#### Complexity
+
+-- TC - $O(n^2)$
+-- SC - $O(1)$
+
+
+:::warning
+Please take some time to think about the Optimised approach on your own before reading further.....
+:::
+
+---
+### Problem 2 Optimised Approach using Moore’s Voting Algorithm
+
+#### Observation 1:
+There can only be **one majority element** in the array.
+
+#### Proof:
+We will prove it by contradiction.
+* Let's say there are two majority elements, say m1 and m2.
+* frequency(m1) > n/2 and frequency(m2) > n/2
+* Adding both sides,
+ * frequency(m1) + frequency(m2) > n **[it not possible]**
+* Hence, Prooved.
+
+
+
+#### Observation 2:
+If we **remove any two distinct elements, the majority element remains the same.**
+
+**Explanation 1:**
+
+> Consider array of 13 blocks.
+First **7 blocks** are filled with **GREEN colour**.
+Next **6 blocks** are filled with **RED colour**.
+**Majority** is **GREEN**.
+If we remove 2 distinct blocks, 1 from GREEN and 1 from RED, we will be left with 11 elements.
+**Majority** is still **GREEN**.
+
+
+
+> Again, If we remove 2 distinct elements, 1 from GREEN and 1 from RED, we will be left with 9 elements.
+**Majority** is still **GREEN**.
+
+
+
+> If we continue this process we will get GREEN as MAJORITY element.
+
+
+**Explanation 2:**
+
+Suppose there are **4 parties** participating in an **election**.
+
+* First: ORANGE party(OP) with **9** candidates.
+* Second: YELLOW party(YP) with **3** candidates.
+* Third: RED party(RP) with **2** candidates.
+* Fourth: GREEN party(GP) with **3** candidates.
+
+Currently, the **WINNER is ORANGE**
+
+
+
+
+
+| Remove | Orange | Yellow | Red | Green | Winner|
+| --- |--- | ---| ----- | ------| ---|
+|1 OP and 1 YP | 8 | 2 | 2 | 3 |Orange
+|1 OP and 1 GP | 7 | 2 | 2 | 2 |Orange
+|1 OP and 1 RP | 6 | 2 | 1 | 2 |Orange
+|1 YP and 1 RP | 6 | 1 | 0 | 2 |Orange
+|1 YP and 1 GP | 6 | 0 | 0 | 1 |Orange
+|1 OP and 1 GP | 5 | 0 | 0 | 0 |Orange
+
+We can observe that after removing 2 distinct party votes every time, majority is maintained at every point.
+
+**Note:** We cannot remove same party votes twice.
+
+
+
+---
+### Problem 2 Moore’s Voting Algorithm Approach and Dry Run
+
+
+#### Approach
+* Iterate through each element of the array, keeping track of the majority element's count and index.
+* If the next element is the same as the current majority element, increase the count; otherwise, decrease the count.
+* If the count becomes zero, update the majority index to the current element and reset the count to 1.
+* After the iteration, go through the array once again and determine the count of the majority element found.
+ * If count > N/2, return majority elsement; else majority element doesn't exist.
+
+#### Dry Run
+Please **dry run** for the following example:
+```plaintext
+A[ ] = { 3, 4, 3, 6, 1, 3, 2, 5, 3, 3, 3 }
+```
+
+#### Pseudocode
+```cpp
+int findCandidate(int a[], int size) {
+ int maj_index = 0, count = 1;
+ for (int i = 1; i < size; i++) {
+ if (count == 0) {
+ maj_index = i;
+ count = 1;
+ } else {
+ if (a[maj_index] == a[i])
+ count++;
+ else
+ count--;
+ }
+ }
+
+ //check if the candidate
+ //occurs more than n/2 times
+ int count = 0;
+ for (int i = 0; i < size; i++) {
+ if (a[i] == a[maj_index])
+ count++;
+ }
+
+ if (count > size / 2)
+ return a[maj_index];
+
+ else
+ return -1;
+}
+```
+
+#### Time and Space Complexity
+
+
+What will be T.C and S.C for this approach?
+-- TC - $O(n)$
+-- SC - $O(1)$
+
+
+---
+### Problem 3 Row to Column Zero
+
+
+You are given a 2D integer matrix A, make all the elements in a row or column zero if the A[i][j] = 0. Specifically, make entire ith row and jth column zero.
+
+**Example**
+**Input:**
+[1,2,3,4]
+[5,6,7,0]
+[9,2,0,4]
+
+**Output:**
+[1,2,0,0]
+[0,0,0,0]
+[0,0,0,0]
+
+**Explanation:**
+A[2][4] = A[3][3] = 0, so make 2nd row, 3rd row, 3rd column and 4th column zero
+
+#### Observation
+If you start row wise and make one row completely zero if it has 0 then you will loose information for making columns zero.
+
+**Note:** None element is negative so see if you may use this for not loosing info.
+
+#### Approach
+
+* Let's start row wise first.
+* Select rows one by one and make all the elements of that row -1(except which are 0), if any element in that row is 0.
+* Similariy you have to do the same thing for columns.
+* Now, before returning traverse the matrix and make all the -1 elements 0.
+
+#### Pseudocode
+```cpp
+int n = A.size(), m = A[0].size();
+for (int i = 0; i < n; i++) {
+ int flag = 0;
+ for (int j = 0; j < m; j++) {
+ if (A[i][j] == 0) flag = 1;
+ }
+ if (flag == 1) {
+ for (int j = 0; j < m; j++) {
+ if (A[i][j] != 0) A[i][j] = -1;
+ }
+ }
+}
+for (int j = 0; j < m; j++) {
+ int flag = 0;
+ for (int i = 0; i < n; i++) {
+ if (A[i][j] == 0) flag = 1;
+ }
+ if (flag == 1) {
+ for (int i = 0; i < n; i++) {
+ if (A[i][j] != 0) A[i][j] = -1;
+ }
+ }
+}
+for (int i = 0; i < n; i++) {
+ for (int j = 0; j < m; j++) {
+ if (A[i][j] == -1) A[i][j] = 0;
+ }
+}
+return A;
+```
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Introduction to Arrays.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Introduction to Arrays.md
new file mode 100644
index 0000000..2ebc1ae
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Introduction to Arrays.md
@@ -0,0 +1,477 @@
+# Introduction To Arrays
+
+## Space Complexity
+
+
+* Space complexity is the max space(worst case) that is utilised at any point in time during running the algorithm.
+* We also determine Space Complexity using **Big O**.
+
+Consider the following example:
+
+```pseudocode
+func(int N) { // 4 bytes
+ int x; // 4 bytes
+ int y; // 4 bytes
+ long z; // 8 bytes
+}
+```
+
+* We only consider the space utilised by our program and not the Input Space since it is not in our control, hence we'll ignore space taken by "int N".
+* The above code takes total **16B** of memory.
+* Hence, we say the **Space Complexity** of the above code is **O(1)** (1 resembles constant).
+
+
+### Question
+Find the Space Complexity [Big(O)] of the below program.
+```pseudocode
+func(int N) { // 4 bytes
+ int arr[10]; // 40 Bytes
+ int x; // 4 bytes
+ int y; // 4 bytes
+ long z; // 8 bytes
+ int[] arr = new int[N]; // 4 * N bytes
+}
+```
+**Choices**
+- [x] N
+- [ ] 4N + 60
+- [ ] Constant
+- [ ] N^2
+
+
+
+### Question
+Find the Space Complexity [Big(O)] of the below program.
+
+```pseudocode
+func(int N) { // 4 bytes
+ int x = N; // 4 bytes
+ int y = x * x; // 4 bytes
+ long z = x + y; // 8 bytes
+ int[] arr = new int[N]; // 4 * N bytes
+ long[][] l = new long[N][N]; // 8 * N * N bytes
+}
+```
+**Choices**
+- [ ] N
+- [ ] 4N + 60
+- [ ] Constant
+- [x] N^2
+
+### Question on Space Complexity
+
+Find the Space Complexity [Big(O)] of the below program.
+
+```cpp
+int maxArr(int arr[], int N) {
+ int ans = arr[0];
+ for(i from 1 to N-1) {
+ ans = max(ans, arr[i]);
+ }
+ return ans;
+}
+```
+
+### Space complexity: O(1)
+
+* Don't consider the space acquired by the input size. Space complexity is the order of extra space used by the algorithm.
+* **arr[]** is already given to us, we didn't create it, hence it'll not be counted in the Space Complexity.
+* **int N** will also not be counted in space but since it is contant hence doesn't matter.
+* Additional space is also called **computational or auxiliary space.**
+* The above code finds the max element of the Array.
+
+### Introduction To Arrays
+
+
+#### Definition
+
+Array is the collection of same types of data. The datatype can be of any type i.e, int, float, char, etc. Below is the declaration of the array:
+```
+int arr[n];
+```
+Here, ‘int’ is the datatype, ‘arr’ is the name of the array and ‘n’ is the size of an array.
+We can access all the elements of the array as arr[0], arr[1] ….. arr[n-1].
+
+**Note:** Array indexing starts with 0.
+##### Why indexing starts at 0 ?
+An array arr[i] is interpreted as *(arr+i). Here, arr denotes the address of the first array element or the 0 index element. So *(arr+i) means the element at i distance from the first element of the array.
+
+
+### Question
+What will be the indices of the first and last elements of an array of size **N**?
+
+Choose the correct answer
+**Choices**
+- [ ] 1,N
+- [x] 0,N-1
+- [ ] 1,N-1
+- [ ] 0,N
+
+
+## Introduction to Arrays Continued
+
+### Print all elements of the array
+
+The elements of arrays can be printed by simply traversing all the elements. Below is the pseudocode to print all elements of array.
+
+```
+void print_array(int arr[],int n){
+ for(int i=0;i=j$
+
+
+### Pseudocode
+
+```cpp
+Function reverse(int arr[], int N) {
+ int i = 0, j = N - 1;
+ while (i < j) {
+ int temp = arr[i];
+ arr[i] = arr[j];
+ arr[j] = temp;
+ i++;
+ j--;
+ }
+}
+```
+
+#### Complexity:
+**Time Complexity - O(N).
+Space Complexity - O(1).**
+
+
+### Question 2 Reverse in a range
+
+Given an array 'arr' of size 'N' and integers 'l' and 'r'. Reverse the array from 'l' to 'r'.
+
+#### TestCase:
+
+#### Input:
+```
+N = 5
+arr = {1,2,3,4,5}
+[0 based index]
+l = 1
+r = 3
+```
+
+#### Output:
+
+```
+arr = {1,4,3,2,5}
+```
+
+
+#### Pseudocode
+
+```cpp
+Function reverse(int arr[], int N, int l, int r) {
+ while (l < r) {
+ int temp = arr[l];
+ arr[l] = arr[r];
+ arr[r] = temp;
+ l++;
+ r--;
+ }
+}
+```
+
+#### Complexity:
+**Time Complexity - O(N).
+Space Complexity - O(1).**
+
+
+### Question 3 Rotate K times
+
+
+Given an array 'arr' of size 'N'. Rotate the array from right to left 'K' times. (i.e, if K = 1, last element will come at first position,...)
+
+#### TestCase:
+
+#### Input:
+```
+N = 5
+arr = {1,2,3,4,5}
+k = 2
+
+```
+
+#### Output:
+
+```
+arr = {4,5,1,2,3}
+```
+
+#### Explanation:
+
+Initially the array is:
+
+| 1 | 2 | 3 | 4 | 5 |
+
+After 1st rotation:
+
+| 5 | 1 | 2 | 3 | 4 |
+
+After 2nd rotation:
+
+| 4 | 5 | 1 | 2 | 3 |
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### BruteForce Approach
+
+Simple approach is to rotate the array one element at a time.
+
+#### Pseudocode
+
+```cpp
+Function rotateK(int arr[], int N, int K) {
+ for (int i = 0; i < K; i++) {
+ int temp = arr[N - 1];
+ for (int j = N - 1; j >= 1; j--) {
+ arr[j] = arr[j - 1];
+ }
+ arr[0] = temp;
+ }
+}
+```
+
+#### Complexity:
+**Time Complexity - O(N*K).
+Space Complexity - O(1).**
+
+
+### Optimized Approach
+
+:::success
+Please take some time to think about the optimised solution approach on your own before reading further.....
+:::
+
+#### Optimized Appraoch Observations
+* After K rotations, last K elements become 1st K elements and rest elements will go at back.
+ For example - Suppose we have an array arr as shown below and k = 3.
+ `1 2 3 4 5 6 7`
+ After 1st rotation, k=1:
+ `7 1 2 3 4 5 6`
+ After 2nd rotation, k=2:
+ `6 7 1 2 3 4 5`
+ After 3rd rotation, k=3:
+ `5 6 7 1 2 3 4`
+So, we have observed that last 3(K=3) elements i.e, `5 6 7` comes in front and rest elements appear at the end.
+
+Therefore, we will first reverse the entire array, then reverse first K elements individually and then next N-K elements individually.
+```
+1 2 3 4 5 6 7 //Given Array, K=3
+
+7 6 5 4 3 2 1 //Reversed Entire Array
+
+5 6 7 4 3 2 1 //Reversed first K elements
+
+5 6 7 1 2 3 4 //Reversed last N-K elements
+```
+
+
+#### Pseudocode
+```cpp
+Function countgreater(int arr[], int N, int k) {
+ reverse(arr, N, 0, N - 1);
+ reverse(arr, N, 0, K - 1);
+ reverse(arr, N, K, N - 1);
+}
+```
+
+#### Edge Case
+
+K might be very large but if we observe carefully then after N rotations the array comes to its initial state.
+Hence, K rotation is equivalent to K%N rotations.
+
+
+Suppose we have an array:
+ `1 2 3 4`
+After 1st rotation, the array becomes:
+ `2 3 4 1`
+After 2nd rotation, the array becomes:
+ `3 4 1 2`
+After 3rd rotation, the array becomes:
+ `4 1 2 3`
+Afer 4th rotation, the array becomes:
+ `1 2 3 4`
+Hence, we have concluded that after **N** rotations, the array become same as before 1st rotation.
+
+### Final Pseudocode
+```cpp
+Function countgreater(int arr[], int N, int K) {
+ K = k % N;
+ reverse(arr, N, 0, N - 1);
+ reverse(arr, N, 0, K - 1);
+ reverse(arr, N, K, N - 1);
+}
+```
+
+#### Complexity:
+**Time Complexity - O(N).
+Space Complexity - O(1).**
+
+
+## Dynamic Arrays
+
+### Question:
+What is the drawback of normal arrays?
+
+#### Issue:
+The size has to be declared before hand.
+
+
+### Dynamic Arrays
+* A dynamic array is an array with a big improvement: automatic resizing.
+* It expands as you add more elements. So you don't need to determine the size ahead of time.
+
+### Strengths:
+**Fast lookups:** Just like arrays, retrieving the element at a given index takes
+O(1) time.
+**Variable size:** You can add as many items as you want, and the dynamic array will expand to hold them.
+
+### Weaknesses:
+
+**Slow worst-case appends:**
+* Usually, adding a new element at the end of the dynamic array takes O(1) time.
+* But if the dynamic array doesn't have any room for the new item, it'll need to expand, which takes O(n) time.
+ * It is because we have to take a new array of bigger size and copy all the elements to a new array and then add a new element.
+ * So, Time Complexity to add a new element to Dynamic array is **O(1) amortised**.
+* Amortised means when most operations take **O(1)** but some operations take **O(N)**.
+
+
+### Dynamic Arrays in Different Languages
+
+#### Java
+```
+ArrayList al = new ArrayList<>(); //Arraylist is created
+```
+
+```
+al.add("50"); //50 is inserted at the end
+```
+
+```
+al.clear(); // al={}
+```
+
+```
+for (int i = 0; i < al.size(); i++) {
+ System.out.print(al.get(i) + " ");
+} //iterating the Arraylist
+```
+
+#### C++
+```
+vector a; //vector is created
+```
+```
+a.push_back(60);
+//a = {10, 20, 30, 40, 50, 60} after insertion at end
+```
+
+```
+a.clear(); // a={}
+```
+```
+for(int i=0; i **N % i == 0**
+
+**Question 1:**
+Given N, we have to count the factors of N.
+**Note:** N > 0
+
+**Question 2:**
+Number of factors of the number 24.
+
+**Choices**
+- [ ] 4
+- [ ] 6
+- [x] 8
+- [ ] 10
+
+
+**Explanation:**
+1, 2, 3, 4, 6, 8, 12, and 24 are the factors.
+
+
+**Question 3:**
+Number of factors of the number 10.
+
+**Choices**
+- [ ] 1
+- [ ] 2
+- [ ] 3
+- [x] 4
+
+**Explanation:**
+1, 2, 5, and 10 are the factors.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Counting Factors Brute force solution
+
+What is the minimum factor of a number ?
+=> 1
+
+What is the maximum factor of a number ?
+=> The number itself
+
+So, we can find all factors of N from 1 to N.
+
+### Pseudocode
+```cpp
+function countfactors (N):
+ fac_count = 0
+ for i = 1 till N:
+ if N % i == 0:
+ fac = fac + 1
+
+ return fac
+```
+
+### Observations for Optimised Solution
+
+* Now, your code runs on servers.
+* When you submit your code, do you expect some time within which it should return the Output ?
+* You wouldn't want to wait when you even don't know how long to wait for ?
+* Just like that one friend who says, 'Just a little more time, almost there.' And you feel annoyed, not knowing how much longer you'll have to wait.
+
+Servers have the capability of running ~10^8 Iterations in 1 sec.
+
+|N| Iterations| Execution Time|
+|-|----------|---------- |
+|10^8| 10^8 iterations| 1 sec |
+|10^9| 10^9 iterations| 10 sec |
+|10^18| 10^18 iterations| 317 years |
+
+
+### Optimisation for Counting Factors
+
+
+**Optimization:**
+
+i * j = N -> {i and j are factors of N}
+
+=> j = N / i -> {i and N / i are factors of N}
+
+For example, N = 24
+
+|i| N / i|
+|-|----------|
+|1| 24|
+|2| 12|
+|3| 8|
+|4| 6|
+|6| 4|
+|8| 3|
+|12| 2|
+|24| 1|
+
+Q. Can we relate these values?
+A. We are repeating numbers after a particular point. Here, that point is from 5th row.
+
+Now, repeat the above process again for N = 100.
+
+|i| N / i|
+|-|----------|
+|1| 100|
+|2| 50|
+|4| 25|
+|5| 20|
+|10| 10|
+|20| 5|
+|25| 4|
+|50| 2|
+|100| 1|
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+The factors are repeating from 6th row. After a certain point factors start repeating, so we need to find a point till we have to iterate.
+
+We need to only iterate till -
+
+
+
+### Pseudocode
+```cpp
+function countfactors (N):
+ fac_count = 0
+ for i = 1 till sqrt(N):
+ if N % i == 0:
+ fac = fac + 2
+
+ return fac
+```
+
+Q. Will the above work in all the cases?
+A. No, not for perfect squares. Explain this for N = 100, what mistake we are doing. We will count 10 twice.
+
+**Observation:** Using the above example, we need to modify the code for perfect squares.
+
+### Pseudocode with Edge Case Covered
+
+```cpp
+function countfactors (N):
+ fac_count = 0
+ for i = 1 till sqrt(N):
+ if N % i == 0:
+ if i == N / i:
+ fac = fac + 1
+ else:
+ fac = fac + 2
+
+ return fac
+```
+
+Dry run the above code for below examples,
+N = 24, 100, 1.
+
+
+|N| Iterations| Execution Time|
+|-|----------|---------- |
+|10^18| 10^9 iterations| 10 secs |
+
+To implement sqrt(n) , replace the condition i <= sqrt(N) by i * i <= N.
+
+
+### Follow Up Question
+Given N, You need to check if it is prime or not.
+
+**Question**
+How many prime numbers are there?
+10, 11, 23, 2, 25, 27, 31
+
+**Choices**
+- [ ] 1
+- [ ] 2
+- [ ] 3
+- [x] 4
+
+
+**Explanation:**
+Q. What is a prime Number?
+A. Number which has only 2 factors, 1 and N itself.
+
+So, 11, 23, 2, and 31 are the only prime numbers since they all have exactly 2 factors.
+
+
+## Prime Check
+
+
+Our original question was to check if a number is prime or not. For that, we can just count the number of factors to be 2.
+
+```cpp
+function checkPrime(N):
+ if countfactors(N) == 2:
+ return true
+ else:
+ return false
+```
+
+For N = 1, it will return false, which is correct. Since, 1 is neither prime nor composite.
+
+
+---
+
+**Question**
+1 + 2 + 3 + 4 + 5 + 6 + .. 100 = ?
+**Choices**
+- [ ] 1010
+- [x] 5050
+- [ ] 5100
+- [ ] 1009
+
+**Explanation:**
+
+
+
+Generalize this for the first N natural numbers.
+
+
+
+## Some basic math properties:
+1. `[a,b]` - This type of range means that a and b are both inclusive.
+2. `(a,b)` - This type of range means that a and b are both excluded.
+
+**Question**
+How many numbers are there in the range [3,10]?
+
+**Choices**
+- [ ] 7
+- [ ] 6
+- [x] 8
+- [ ] 10
+
+
+**Explanation:**
+The range [3,10] includes all numbers from 3 to 10, inclusive. Inclusive means that both the lower bound (3) and the upper bound (10) are included in the range. Thus the numbers that are included are 3 4 5 6 7 8 9 10.
+
+
+**Question**
+How many numbers are there in the range [a,b]?
+
+**Choices**
+- [ ] b-a
+- [x] b-a+1
+- [ ] b-a-1
+
+**Explanation:**
+To find the number of numbers in a given range, we can subtract the lower bound from the upper bound and then add 1. Mathematically, this can be expressed as:
+```
+Number of numbers in the range
+= Upper bound - Lower bound + 1
+```
+
+### What do we mean by Iteration?
+
+The number of times a loop runs, is known as Iteration.
+
+
+**Question**
+How many times will the below loop run ?
+
+```cpp
+for(i=1; i<=N; i++)
+{
+ if(i == N) break;
+}
+```
+
+**Choices**
+- [ ] N - 1
+- [x] N
+- [ ] N + 1
+- [ ] log(N)
+
+
+**Question**
+How many iterations will be there in this loop ?
+
+```cpp
+for(int i = 0; i <= 100; i++){
+ s = s + i + i^2;
+}
+```
+
+**Choices**
+- [ ] 100 - 1
+- [ ] 100
+- [x] 101
+- [ ] 0
+
+**Question**
+How many iterations will be there in this loop?
+```cpp
+func(){
+ for(int i = 1; i <= N; i++){
+ if(i % 2 == 0){
+ print(i);
+ }
+ }
+ for(int j = 1; j <= M; j++){
+ if(j % 2 == 0){
+ print(j);
+ }
+ }
+}
+```
+
+**Choices**
+- [ ] N
+- [ ] M
+- [ ] N * M
+- [x] N + M
+
+
+**Explanation:**
+We are executing loops one after the other. Let's say we buy first 5 apples and then we buy 7 apples, the total apples will be 12, so correct ans is N + M
+
+
+
+## Geometric Progression (G.P.)
+> **Example for intution:**
+```
+5 10 20 40 80 ..
+```
+In these type of series, the common ratio is same. In the given example the common ratio r is
+= 10/5
+= 20/10
+= 40/20
+= 80/40
+= 2
+
+**Generic Notation:**
+a, a * r, a * r^2, ...
+
+### Sum of first N terms of a GP
+
+
+**Sum of first N terms of GP:**
+=
+
+
+r cannot be equal to 1 because the denominator cannot be zero.
+
+**Note:**
+When r is equal to 1, the sum is given by a * n.
+
+## How to compare two algorithms?
+
+
+**Story**
+There was a contest going on to SORT the array and 2 people took part in it (say Gaurav and Shila).
+
+They had to sort the array in ascending order.
+
+arr[5] = {3, 2, 6, 8, 1} -> {1, 2, 3, 6, 8}
+
+Both of them submitted their algorithms and they are being run on the same input.
+
+### Discussion
+
+**Can we use execution time to compare two algorithms?**
+
+Say initially **Algo1** took **15 sec** and **Algo2** took **10sec**.
+
+This implies that **Shila's Algo 1** performed better, but then Gaurav pointed out that he was using **Windows XP** whereas Shila was using **MAC**, hence both were given the same laptops.........
+
+
+
+### Conclusion
+We can't evaluate algorithm's performance using **execution time** as it depends on a lot of factors like operating system, place of execution, language, etc.
+
+**Question**
+How can we compare two algorithms?
+Which measure doesn't depend on any factor?
+
+**Answer:** Number of Iterations
+
+**Why?**
+* The number of iterations of an algorithm remains the same irrespective of Operating System, place of execution, language, etc.
+
+
+
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Memory Management.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Memory Management.md
new file mode 100644
index 0000000..ec7a72c
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Memory Management.md
@@ -0,0 +1,523 @@
+# Beginner : Memory Management
+
+---
+## Introduction to stack
+
+### Idli Maker Examples
+
+
+
+
+### Stack
+
+
+
+
+:::success
+There are a lot of quizzes in this session, please take some time to think about the solution on your own before reading further.....
+:::
+
+---
+### Introduction to call stack
+
+#### Example 1
+Consider the below code:
+```java
+int add(int x, int y) {
+ return x + y;
+}
+
+int product(int x, int y) {
+ return x * y;
+}
+
+int subtract(int x, int y) {
+ return x - y;
+}
+
+public static void main() {
+ int x = 10;
+ int y = 20;
+ int temp1 = add(x, y);
+ int temp2 = product(x, y);
+ int temp3 = subtract(x, y);
+ System.out.println(temp1 + temp2 + temp3);
+}
+```
+
+Following is the call stack execution for above code:
+
+
+
+
+
+**Ouput:** 220
+
+#### Example 2
+Consider the below code:
+```java
+int add(int x, int y) {
+ return x + y;
+}
+
+public static void main() {
+ int x = 10;
+ int y = 20;
+ int temp1 = add(x, y);
+ int temp2 = add(temp1, 30);
+ int temp3 = add(temp2, 40);
+ System.out.println(temp3);
+}
+```
+Following is the call stack execution for above code:
+
+
+
+
+
+**Output:** 100
+
+#### Example 3
+Consider the below code:
+```java
+int add(int x, int y) {
+ return x + y;
+}
+
+static int fun(int a, int b) {
+ int sum = add(a, b);
+ int ans = sum * 10;
+ return ans;
+}
+static void extra(int w){
+ System.out.println("Hello");
+ System.out.println(w);
+}
+public static void main() {
+ int x = 10;
+ int y = 20;
+ int z = fun(x, y);
+ System.out.println(z);
+ extra(z);
+}
+```
+
+Following is the call stack execution for above code:
+
+
+
+
+**Output:**
+```plaintext
+300
+Hello
+310
+```
+
+---
+
+### Types of Memory in Java
+Following are the types of memory present in Java -
+1. **Stack** -
All the primitive data type and reference will be stored in stack.
+2. **Heap** -
Container of that reference is stored in heap. Arrays, ArrayList, Objects are created inside heap.
+
+**Example 1**
+Consider the below code:
+```java
+public static void main() {
+ int x = 10;
+ int[] ar = new int[3];
+ System.out.println(ar); // #ad1
+ System.out.println(ar[2]); // 0
+ ar[1] = 7;
+}
+```
+Now, lets analyze the given code -
+
+
+
+
+
+**Note**:
+1. **Primitive data types:** [int, float, double, char, boolean, long] memory will be assigned in stack.
+2. **Reference/ address of the container:** will be stored in stack.
+3. **Container:** [Array/ Arraylist] will be stored in heap.
+
+**Example 2**
+Consider the below code:
+```java
+public static void main() {
+ int x = 10;
+ int[] ar = new int[3];
+ int[] ar2 = ar;
+ System.out.println(ar); // 4k
+ System.out.println(ar2); // 4k
+}
+```
+Now, lets analyze the given code -
+
+
+
+
+
+
+**Example 3**
+Consider the below code:
+```java
+public static void main() {
+ int[] ar = new int[3];
+ System.out.println(ar); // 5k
+ ar[1] = 9;
+ ar[2] = 5;
+
+ ar = new int[5];
+ System.out.println(ar); // 7k
+}
+```
+Now, lets analyze the given code -
+
+
+
+
+**Example 4**
+Consider the below code:
+```java
+static void fun(int[] a){
+ System.out.println(a); // 9k
+ a[1] = 5;
+}
+public static void main() {
+ int[] ar = new int[3];
+ System.out.println(ar); // 9k
+ ar[0] = 90;
+ ar[1] = 50;
+ fun(ar);
+ System.out.println(ar[1]); // 5
+}
+```
+Now, lets analyze the given code -
+
+
+
+
+**Example 5**
+Consider the below code:
+```java
+public static void main() {
+ float y = 7.84f;
+ int[][] mat = new int[3][4];
+ System.out.println(mat); // 9k
+ System.out.println(mat[1]); // 3k
+ System.out.println(mat[1][3]); // 0
+}
+```
+Now, lets analyze the given code -
+
+
+
+
+
+
+**Example 6**
+Consider the below code:
+```java
+static void sum(int[][] mat){
+ System.out.println(mat); // 2k
+ System.out.println(mat[0][0] + mat[1][0]); // 40
+}
+public static void main() {
+ int[][] mat = new int[2][3];
+ mat[0][0] = 15;
+ mat[1][0] = 25;
+ sum(mat);
+}
+```
+Now, lets analyze the given code -
+
+
+
+
+
+
+
+**Example 7**
+
+Consider the below code:
+```java
+static int sumOfRow(int[] arr){
+ System.out.println(arr); // 7k
+ int sum = 0;
+ for (int i = 0; i < arr.length; i++){
+ sum = sum + arr[i];
+ }
+ return sum;
+}
+
+public static void main() {
+ int[][] mat = new int[2][3];
+ mat[0][0] = 9;
+ mat[0][1] = 5;
+ mat[0][2] = 1;
+ int ans = sumOfRow(mat[0]); // 7k
+ System.out.println(ans); // 15
+}
+```
+Now, lets analyze the given code -
+
+
+
+### Question
+Predict the Output :
+```Java
+static void change(int a) {
+ a = 50;
+}
+
+public static void main(String args[]) {
+ int a = 10;
+ change(a);
+ System.out.println(a);
+}
+```
+
+
+**Choices**
+- [x] 10
+- [ ] 50
+- [ ] Error
+
+
+
+**Explanation**
+
+
+
+
+
+
+* The parameter variable 'a' of change function is reassigned to the value of 50, because both the functions have their own variables, so the variable "a" of main function is different than of variable "a" in change function.
+* Stack changes are temporary.
+
+---
+### Question
+Predict the output :
+```java
+static void change(int[]a) {
+ a[0] = 50;
+}
+
+public static void main(String args[]) {
+ int[]a = {10};
+ change(a);
+ System.out.println(a[0]);
+}
+```
+
+**Choices**
+- [ ] 10
+- [x] 50
+- [ ] Error
+
+---
+
+**Explanation:**
+
+* The array a in change method and main method both refer to the same array object in the heap.
+* Heap changes are permanent changes.
+
+
+
+
+
+
+---
+### Question
+Predict the output :
+```java
+static void test(int[]a) {
+ a = new int[1];
+ a[0] = 50;
+}
+
+public static void main(String args[]) {
+ int[]a = {10};
+ test(a);
+ System.out.println(a[0]);
+}
+```
+
+
+**Choices**
+- [x] 10
+- [ ] 50
+- [ ] Error
+
+---
+**Explanation:**
+Inside the test method, a new integer array with length 1 is allocated on the heap memory, and the reference to this array is assigned to the parameter variable a. Hence, now the variable 'a' inside test function and main function point to different references.Heap changes are permanent.
+
+
+
+
+
+
+---
+### Question
+
+Predict the output:
+```java
+static void fun(int[] a) {
+ a = new int[1];
+ a[0] = 100;
+}
+public static void main() {
+ int[] a = {10, 20, 30};
+ fun(a);
+ System.out.println(a[0]);
+}
+
+```
+
+**Choices**
+- [x] 10
+- [ ] 100
+- [ ] Error
+- [ ] inky pinky po
+
+**Explanation:**
+
+Inside the fun method, a new integer array with length 1 is allocated on the heap memory, and the reference to this array is assigned to the parameter variable a. Hence, now the variable 'a' inside test function and main function point to different references.
+
+
+
+
+
+
+---
+
+### Question
+Predict the output :
+```java
+static void swap(int a,int b) {
+ int temp = a;
+ a = b;
+ b = temp;
+}
+
+public static void main(String args[]) {
+ int a = 10;
+ int b = 20;
+ swap(a,b);
+ System.out.println(a + " " + b);
+}
+```
+
+
+**Choices**
+- [x] 10 20
+- [ ] 20 10
+- [ ] 10 10
+- [ ] Error
+
+**Explanation:**
+
+* Swap function is called by value not by reference.
+* So, the changes made in the swap function are temporary in the memory stack.
+* Once we got out of the swap function, the changes will go because they are made in temporary variables.
+* Hence no swapping is done and variable have the same value as previous.
+
+
+
+
+
+
+---
+### Question
+Predict the output :
+```java
+static void swap(int[]a,int[]b) {
+ int temp = a[0];
+ a[0] = b[0];
+ b[0] = temp;
+}
+
+public static void main(String args[]) {
+ int[]a = {10};
+ int[]b = {20};
+ swap(a,b);
+ System.out.println(a[0] + " " + b[0]);
+}
+```
+**Choices**
+- [ ] 10 20
+- [x] 20 10
+- [ ] 10 10
+- [ ] Error
+
+**Explanation:**
+Inside swap function, the array variables 'a' & 'b' are passed by reference, so they are pointing to same references in the heap memory as of 'a' & 'b' variables inside main function.
+
+
+
+
+
+---
+### Question
+Predict the output :
+```java
+static int[] fun(int[]a) {
+ a = new int[2];
+ a[0] = 50; a[1] = 60;
+ return a;
+}
+
+public static void main(String args[]) {
+ int[]a = {10,20,30};
+ a = fun(a);
+ System.out.println(a[0]);
+}
+```
+
+**Choices**
+- [ ] 10
+- [x] 50
+- [ ] Error
+
+
+
+**Explanation:**
+* When fun method is called on array a, then a new integer array is allocated on the heap memory.
+* But since, we are returning the new array in the main method, so now the changes done in fun method persists.
+
+
+
+
+
+---
+### Question
+Predict the output :
+```java
+static void test(int[]a) {
+ a = new int[2];
+ a[0] = 94;
+}
+
+public static void main(String args[]) {
+ int[]a = {10,20,30};
+ test(a);
+ System.out.println(a[0]);
+}
+```
+
+
+**Choices**
+- [x] 10
+- [ ] 94
+- [ ] Error
+
+**Explanation:**
+
+Inside the test function, a new integer array with length 2 is allocated on the heap memory, and the reference to this array is assigned to the parameter variable a. Hence, now the variable 'a' inside test function and main function point to different references.
+
+
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Sorting Basics.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Sorting Basics.md
new file mode 100644
index 0000000..f48ace7
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Sorting Basics.md
@@ -0,0 +1,454 @@
+# Sorting
+
+## Introduction
+
+
+**Sorting** is an arrangement of data in particular order on the basis of some parameter
+
+### Example 1:
+```
+ A[ ] = { 2, 3, 9, 12, 17, 19 }
+```
+
+The above example is sorted in ascending order on the basis of magnitude.
+
+### Example 2:
+```
+ A[ ] = { 19, 6, 5, 2, -1, -19 }
+```
+
+The above example is sorted in descending order on the basis of magnitude.
+
+
+
+### Question
+Is the array { 1, 13, 9 , 6, 12 } sorted ?
+
+**Choices**
+- [x] Yes
+- [ ] No
+
+
+In the above quiz, array is sorted in ascending order on the basis of count of factors. Count of factors for the above array is { 1, 2, 3, 4, 6 }.
+
+
+
+**Sorting** is essential for organizing, analyzing, searching, and presenting data efficiently and effectively in various applications and contexts.
+
+### Problem 1 : Minimize the cost to empty array
+
+
+Given an array of **n** integers, minimize the cost to empty given array where cost of removing an element is equal to **sum of all elements left in an array**.
+
+### Example 1
+
+```plaintext
+A[ ] = { 2, 1, 4 }
+Ans = 11
+```
+
+**Explanation**
+After removing 4 cost = 4+2+1 = 7
+After removing 2 cost = 2+1 = 3
+After removing 1 cost = 1 = 1
+
+Total cost = 11
+
+
+### Question
+Minimum cost to remove all elements from array {4, 6, 1} ?
+
+**Choices**
+- [ ] 11
+- [ ] 15
+- [x] 17
+- [ ] 21
+
+
+
+After removing 6 cost = 4+6+1 = 11
+After removing 4 cost = 4+1 = 5
+After removing 1 cost = 1 = 1
+
+Total cost = 17
+
+
+### Question
+Minimum cost to remove all elements from array[] = {3, 5, 1, -3}
+
+**Choices**
+- [ ] 4
+- [x] 2
+- [ ] 0
+- [ ] 18
+
+
+
+After removing 5 cost = 5+3+1+(-3) = 6
+After removing 3 cost = 3+1+(-3) = 1
+After removing 1 cost = 1+(-3) = -2
+After removing -3 cost = -3) = -3
+
+Total cost = 2
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Problem 1 Solution Approach
+
+**Observation**
+* Start removing from the largest element.
+
+
+
+Here we can see if we have to minimise the cost we should add the largest number minimum number of times, that implies it should be the first one to be removed.
+The formula would be **$\sum$(i+1)\*arr[i]** where **i** is the index.
+
+Follow the below steps to solve the problem.
+* **Sort** the data in descending order.
+* Initialise the **ans** equal to 0.
+* Run a loop for i from 0 to **n** – 1, where **n** is the size of the array.
+* For every element add **arr[i]\*i** to the ans.
+
+#### Pseudocode
+```cpp
+int calculate_cost(int arr[], int n) {
+ reverse_sort(arr);
+ int ans = 0;
+ for (int i = 0; i < n; i++) {
+ ans += i * arr[i];
+ }
+
+ return ans;
+}
+```
+
+#### Time and Space Complexity
+
+-- TC - O(nlogn)
+-- SC - O(n)
+
+### Problem 2 : Find count of Noble Integers
+
+
+Given an array of distinct elements of size n, find the count of **noble integers**.
+
+> Note: arr[i] is **noble** if count of elements smaller than arr[i] is equal to arr[i] where arr[i] is element at index i.
+
+**Example 1**
+
+```plaintext
+A[ ] = { 1, -5, 3, 5, -10, 4}
+Ans = 3
+```
+
+**Explanation**
+For arr[2] there are three elements less than 3 that is 1, -5 and -10. So arr[0] is noble integer.
+For arr[3] there are five elements less than 5 that is 1, 3, 4, 5, -5 and -10. So arr[3] is noble integer.
+For arr[5] there are four elements less than 4 that is 1, 3, -5 and -10. So arr[5] is noble integer.
+
+In total there are 3 noble elements.
+
+
+### Question
+Count the number of noble integers in the array. A = { -3, 0, 2 , 5 }
+
+**Choices**
+- [ ] 0
+- [x] 1
+- [ ] 2
+- [ ] 3
+
+
+
+**Explanation:**
+For arr[2] there are two elements less than 2 that is -3 and 0. So arr[2] is noble integer.
+In total there are 2 noble elements.
+
+:::warning
+Please take some time to think about the Brute Force solution approach on your own before reading further.....
+:::
+
+### Problem 2 : Bruteforce Solution
+
+#### Observation
+Iterate through every element in the array, for every element count the number of smaller elements.
+
+#### Pseudocode
+```cpp
+int find_nobel_integers(int arr[], int n) {
+ int ans = 0;
+ for (int i = 0; i < n; i++) {
+ int count = 0;
+ for (int j = 0; j < n; j++) {
+ if (arr[j] < arr[i])
+ count++;
+ }
+ if (count == arr[i]) {
+ ans++;
+ }
+ }
+ return ans;
+}
+```
+
+#### Time and Space Complexity
+-- TC - O(N^2)
+-- SC - O(1)
+
+### Problem 1 Optimised Solution
+
+#### Optimised Solution - 1
+
+* Hint 1: What is the extra work being done?
+Expected: For every element, we are using an extra loop for calculating the count of smaller elements.
+* Hint 2: Can sorting the array help here?
+
+#### Observation:
+ If we sort the data all elements smaller than the element at index i will be on from index **0 to i-1**. So total number of smaller elements will be equal to **i**.
+
+#### Pseudocode
+```cpp
+
+int find_nobel_integers(int arr[], int n) {
+ sort(arr);
+ int ans = 0;
+ for (int i = 0; i < n; i++) {
+ if (arr[i] == i) {
+ ans = ans + 1;
+ }
+ }
+ return ans;
+}
+```
+
+#### Time and Space Complexity
+-- TC - O(nlogn)
+-- SC - O(1)
+
+### Problem 3 Find count of nobel integers (Not Distinct)
+
+Given an array of size n, find the count of noble integers.
+> Note: Same as previous question, but all elements need not to be distinct
+
+### Question
+
+Count the no of noble integers in the array. A = { -10, 1, 1, 3, 100 }
+
+**Choices**
+- [ ] 1
+- [x] 3
+- [ ] 2
+- [ ] 4
+
+
+**Explanation:**
+For arr[1] and arr[2] there is one element less than 1. So arr[1] and arr[2] are noble integers.
+Similarly arr[3] will be the npble lement as there are 3 elements less than 3.
+So in total 3 elements are noble integers.
+
+### Question
+Count the no of noble integers in the array
+A = { -10, 1, 1, 2, 4, 4, 4, 8, 10 }
+
+**Choices**
+- [ ] 4
+- [x] 5
+- [ ] 6
+- [ ] 7
+
+
+
+**Explanation:**
+arr[1], arr[2], arr[4], arr[5], arr[6] are the noble elements here.
+
+
+### Question
+Count the no of noble integers in the array
+A = { -3, 0, 2, 2, 5, 5, 5, 5, 8, 8, 10, 10, 10, 14 }
+
+**Choices**
+- [ ] 4
+- [ ] 5
+- [ ] 6
+- [x] 7
+
+
+**Explanation:**
+For arr[8] and arr[9] there are eight elements less than 8 that is -3, 0, 2, 5. So arr[8] and arr[9] are noble integers.
+Similarly arr[9], arr[10], arr[11], ar[12] are noble elements.
+So in total 6 elements are noble integers.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Problem 3 Solution
+#### Observation
+* If the current element is same as previous element then the total number of smaller elements will be same as previous element.
+* If current element is not equal to previous element then the total number of smaller elements is equal to its index.
+
+#### Pseudocode
+```cpp
+
+int find_nobel_integers(int arr[], int n) {
+ sort(arr);
+ int count = 0, ans = 0;
+ if (arr[0] == 0) ans++;
+
+ for (int i = 1; i < n; i++) {
+ if (arr[i] != arr[i - 1])
+ count = i;
+
+ if (count == arr[i])
+ ans++;
+ }
+ return ans;
+}
+```
+
+#### Time and Space Complexity
+-- TC - O(nlogn)
+-- SC - O(1)
+
+## Sorting Algorithm - Selection Sort
+
+
+A sorting algorithm is a method of reorganizing the elements in a meaningful order.
+
+> Imagine this. You are asked to arrange students according to their increasing heights.
+
+**Divide the queue of students into two parts – arranged and unarranged.**
+
+1. To begin with, place all the students in the unarranged queue.
+2. From this unarranged queue, search for the shortest student and place him/her in the list of arranged students.
+3. Again, from the unarranged queue, select the second-shortest student. Place this student in the arranged queue, just after the smallest student.
+4. Repeat the above-given steps until all the students are placed into the arranged queue.
+
+**Did you see what we just did here?**
+We used the selection sort algorithm to arrange all the students in a height-wise order.
+
+
+**To better understand selection sort, let's consider a list of Integers 5, 6, 4, 2.**
+
+
+The steps to sort this list would involve –
+
+
+
+
+#### Pseudocode:
+
+```cpp
+void selectionSort(int arr[], int size) {
+ int i, j, minIndex;
+
+ for (i = 0; i < size - 1; i++) {
+
+ // set minIndex equal to the first unsorted element
+ minIndex = i;
+
+ //iterate over unsorted sublist and find the minimum element
+ for (j = i + 1; j < size; j++) {
+
+ if (arr[j] < arr[minIndex]) {
+ minIndex = j;
+ }
+
+ }
+
+ // swapping the minimum element with the element at minIndex to place it at its correct position
+ swap(arr[minIndex], arr[i]);
+ }
+}
+```
+
+#### TC & SC
+
+**Time Complexity:** O(N2) since we have to iterate entire list to search for a minimum element everytime.
+For 1 element, N iterations,
+For N elements, N2 iterations.
+
+**Space Complexity:** O(1)
+
+## Sorting Algorithm - Insertion Sort
+
+**Insertion Sort** is one of the simplest sorting techniques which you might have used in your daily lives while arranging a deck of cards.
+
+> So without going into how this algorithm works, let’s think about how you would usually go about arranging the deck of cards?
+
+**Say you are given 10 cards, 1 to 10 of spades, all shuffled, and you want to sort these cards.**
+
+1. You would basically pick any random card(e.g. 7), and place it into your left hand, assuming the left hand is meant to carry the sorted cards.
+2. Then you would pick another random card, say 2, and place 2 in the correct position on your left hand, i.e. before 7.
+3. Then again if you pick 5, you would place it between 2 and 7 on your left hand, and this way we know we are able to sort our deck of cards. Since we insert one element at a time in its correct position, hence its name “Insertion Sort”.
+
+#### Dry Run
+
+E.g. if elements were in order:
+
+```3, 5, 2```
+
+You can start by picking 3, and since there is no element to the left of 3, we can assume it is in the correct place.
+Array:
+
+```3, 5, 2```
+
+You can pick 5, you compare 5 with 3, and you find 5 is in the correct order amongst the array of [3, 5].
+Array:
+
+```3, 5, 2```
+
+Then you pick 2, you find the place in the left side array of [3,5] to place this 2. Since 2 must come before 3, we insert 2 before 3.
+Array:
+
+```2, 3, 5 →```
+
+Which is a sorted order.
+
+
+#### Approach
+
+Line 2: We don’t process the first element, as it has nothing to compare against.
+Line 3: Loop from i=1 till the end, to process each element.
+Line 4: Extract the element at position i i.e. array[i]. Let it be called E.
+Line 5: To compare E with its left elements, loop j from i-1 to 0
+Line 6, 7: Compare E with the left element, if E is lesser, then move array[j] to right by 1.
+Line 8: Once we have found the position for E, place it there.
+
+#### Pseudocode
+
+```cpp
+void insertionSort(int arr[], int n) {
+ for (int i = 1; i < n; i++) { // Start from 1 as arr[0] is always sorted
+ Int currentElement = arr[i];
+ Int j = i - 1;
+ // Move elements of arr[0..i-1], that are greater than key,
+ // to one position ahead of their current position
+ while (j >= 0 && arr[j] > currentElement) {
+ arr[j + 1] = arr[j];
+ j = j - 1;
+ }
+ // Finally place the Current element at its correct position.
+ arr[j + 1] = currentElement;
+ }
+}
+```
+
+#### TC & SC
+
+**Time Complexity:**
+
+**Worst Case:** O(N^2), when the array is sorted in reverse order.
+
+**Best Case:** O(N), when the data is already sorted in desied order, in that case there will be no swap.
+
+Space Complexity: O(1)
+
+**Note**
+
+1. Both Selection & Insertion are in-place sorting algorithms, means they don't need extra space.
+2. Since the time complexity of both can go to O(N^2), it is only useful when we have a lesser number of elements to sort in an array.
+
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Strings.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Strings.md
new file mode 100644
index 0000000..52942f7
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Strings.md
@@ -0,0 +1,382 @@
+
+# String
+
+A string can be defined as a sequence of characters or in other words we can say that it is an array of characters.
+
+**Example**
+Below are the examples of string:
+```
+"Welcome to Scaler"
+"Hello World!"
+```
+**Note:** String is represented using double quote i.e, `""`. All the characters of string must be inside this quote.
+
+**Character**
+A character is a single symbol that represents a letter, number, or other symbol in a computer's character set. Characters are used to represent textual data, and they are typically represented using its ASCII value.
+
+**Example**
+```
+'a'
+'B'
+'1'
+'_'
+```
+
+Computer store everything in binary. So, how do we store strings in computer?
+
+Each character has corresponding decimal value associated to it which is known as ASCII value.
+
+**'A' to 'Z'** have ASCII from **65 to 90**
+**'a' to 'z'** have ASCII from **97 to 122**
+**'0' to '9'** have ASCII from **48 to 57**
+
+Each character '?', '!', '\*', ... has a corresponding ASCII associated with it.
+
+### Some Operations:
+**Note:** Characters can also be printed using its ascii value. for example, the ascii value of 'A' is 65, so it can be printed as
+```CPP
+char ch = (char)65;
+print(ch);
+/*
+character 'A' gets printed; we are assigning Integer to Char,hence in some languages typecasting will be required.
+*/
+```
+
+```cpp=
+char ch = (char)('a' + 1);
+/*
+When we do arithmetic operations on characters, automatically computations happen on their ASCII values.
+ */
+print(ch); //'b' will get printed
+```
+
+```cpp=
+int x = 'a';
+/*
+No need to typecast since we are assigning Char to Int (smaller data type to bigger, so it will not overflow)
+*/
+print(x); //97 will be printed
+
+```
+
+
+
+## Question 1 : Switch cases
+
+
+Given a string consisting of only alphabets(either lowercase or uppercase). Print all the characters of string in such a way that for all lowercase character, print its uppercase character and for all uppercase character, print its lowercase character.
+
+**TestCase**
+**Input**
+```
+"Hello"
+```
+**Output**
+```
+"hELLO"
+```
+**Explanation**
+
+Here, there is only one uppercase character present in the string i.e, 'H' so convert it to lowercase character. All other characters are in lowercase, hence they are converted into uppercase characters.
+
+
+
+### Question
+What is the output for String = "aDgbHJe" ?
+
+**Choices**
+- [ ] ADGBHJE
+- [ ] aDgbHJe
+- [x] AdGBhjE
+- [ ] adgbhje
+
+---
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+**Observation**
+The key observations are:
+* Lowercase characters can be changed into uppercase by subtracting 32 from its ASCII values.
+* Uppercase charactes can be changed into lowercase by adding 32 from its ASCII values.
+
+The above points are derived from the fact that for every alphabet, the difference between its ascii value in lowercase and uppercase is 32.
+
+#### Pseudocode
+```cpp
+Function toggle(char s[]) {
+ int n = s.size();
+ for (int i = 0; i < n; i++) {
+ if (s[i] >= 65 and s[i] <= 91) {
+ print(s[i] + 32);
+ } else {
+ print(s[i] - 32);
+ }
+ }
+}
+```
+#### Complexity
+Time Complexity- **O(N)**.
+Space Complexity- **O(1)**.
+
+
+## Substring
+A substring is a contiguous sequence of characters within a string. A substring concept in string is similar to subarray concept in array.
+
+**A substring can be:**
+1. Continous part of string.
+2. Full string can be a substring.
+3. A single character can also be a subsring.
+
+**Example**
+
+Suppose, we have a string as
+```
+"abc"
+```
+There are total 6 substring can be formed from the above string. All substrings are
+```
+"a"
+"b"
+"c"
+"ab"
+"bc"
+"abc"
+```
+### Question
+How many total substrings will be there for the String "bxcd" ?
+
+**Choices**
+- [ ] 7
+- [ ] 8
+- [x] 10
+- [ ] 9
+---
+
+**Explanation:**
+All the substrings are as follows-
+```
+"b", "x", "c", "d", "bx", "xc", "cd", "bxc", "xcd", "bxcd"
+```
+We can also find the count using n*(n+1)/2.
+
+### Question 2 Check Palindrome
+
+
+Check whether the given substring of string **s** is palindrome or not.
+A palindrome is the sequence of characters that reads the same forward and backward.for example, "nayan", "madam", etc.
+
+**TestCase**
+
+**Input**
+```
+s = "anamadamspe"
+start = 3
+end = 7
+```
+**Output**
+```
+true
+```
+**Explanation**
+The substring formed from index 3 to 7 is "madam" which is palindrome.
+
+### Question 2 Approach
+
+#### Approach
+Below is the simple algorithm to check whether the substring is palindrome or not:
+* Initialize two indices *start* and *end* to point to the beginning and *end* of the string, respectively.
+* While *start* is less than *end*, do the following:
+ * If the character at index *start* is not equal to the character at index *end*, the string is not a palindrome. Return false.
+ * Else, increment *start* and decrement *end*.
+* If the loop completes without finding a non-matching pair, the string is a palindrome. Return true.
+
+#### Pseudocode
+```cpp
+function ispalindrome(char s[], int start, int end) {
+ while (start < end) {
+ if (s[start] != s[end]) {
+ return false;
+ } else {
+ start++;
+ end--;
+ }
+ }
+ return true;
+}
+```
+
+
+#### Complexity
+
+Time Complexity- **O(N)**.
+Space Complexity- **O(1)**.
+
+
+## Question 3 : Longest Palindromic substring
+Given a string **s**, calculate the length of longest palindromic substring in **s**.
+
+**TestCase**
+**Input**
+```
+"anamadamm"
+```
+**Output**
+```
+5
+```
+**Explanation**
+The substring "madam" of size 5 is the longest palindromic substring that can be formed from given string.
+
+
+
+### Question
+What is the length of longest palindromic substring within string "feacabacabgf" ?
+
+**Choices**
+- [ ] 6
+- [ ] 3
+- [x] 7
+- [ ] 10
+
+
+### Question
+What is the length of longest palindromic substring within string "a d a e b c d f d c b e t g g t e" ?
+
+**Choices**
+- [ ] 6
+- [ ] 3
+- [x] 9
+- [ ] 10
+
+
+:::warning
+Please take some time to think about the brute force solution approach on your own before reading further.....
+:::
+
+
+### Question 4 Brute Force Approach
+
+
+The naive approach is to for all the substring check whether the string is palindrome or not. if it is palindrome and its size is greater than the previous answer(which is initially 0), then update the answer.
+
+#### Pseudocode
+
+```cpp
+function longestPalindrome(char s[]) {
+ int N = s.size();
+ int ans = 0;
+ for (int i = 0; i < N; i++) {
+ for (int j = i; j < N; j++) {
+ if (ispalindrome(s, i, j)) {
+ ans = max(ans, j - i + 1);
+ }
+ }
+ }
+ return ans;
+}
+```
+
+#### Complexity
+
+Time Complexity- **O(N^3)**.
+Space Complexity- **O(1)**.
+
+
+#### Idea
+The key idea here is that:
+* For odd length substring, take every character as a center and expand its center and gets maximum size palindromic substring.
+* For even length substring, take every adjacent character as a center and expand its center and get maximum size palindromic substring.
+
+
+#### Pseudocode
+```cpp
+function longestpalindrome(char s[]) {
+ int maxlength = 0;
+ int N = s.size();
+ for (int c = 0; c < N; c++) {
+
+ //odd length string
+ int left = c, right = c;
+ while (left >= 0 and right < N) {
+ if (s[left] != s[right]) {
+ break;
+ }
+ left--;
+ right++;
+ }
+ maxlength = max(maxlength, right - left - 1);
+
+ //even length string
+ left = c;
+ right = c + 1;
+ while (left >= 0 and right < N) {
+ if (s[left] != s[right]) {
+ break;
+ }
+ left--;
+ right++;
+ }
+ maxlength = max(maxlength, right - left - 1);
+ }
+ return maxlength;
+}
+```
+
+#### Complexity
+
+Time Complexity- **O(N^2)**.
+Space Complexity- **O(1)**.
+
+### Immutability of Strings
+
+In languages like **Java, C#, JavaScript, Python and Go**, strings are immutable, which means it's **value can't be changed**.
+
+```cpp=
+String s1 = "Hello"; // String literal
+String s2 = "Hello"; // String literal
+String s3 = s1; // same reference
+```
+
+
+
+* As seen above, because strings with the same content share storage in a single pool, this minimize creating a copy of the same value.
+* That is to say, once a String is generated, its content cannot be changed and hence changing content will lead to the creation of a new String.
+
+```cpp=
+//Changing the value of s1
+s1 = "Java";
+
+//Updating with concat() operation
+s2.concat(" World");
+
+//The concatenated String will be created as a new instance and an object should refer to that instance to get the concatenated value.
+String newS3 = s3.concat(" Scaler");
+
+System.out.println("s1 refers to " + s1);
+System.out.println("s2 refers to " + s2);
+System.out.println("s3 refers to " + s3);
+System.out.println("newS3 refers to " + newS3);
+```
+
+**Output**
+
+```cpp=
+s1 refers to Java
+s2 refers to Hello
+s3 refers to Hello
+news3 refers to Hello Scaler
+```
+
+
+
+As shown above, considering the example:
+
+* String s1 is updated with a new value and that's why a new instance is created. Hence, s1 reference changes to that newly created instance "Java".
+* String s2 and s3 remain unchanged as their references were not changed to a new instance created after performing concat() operation.
+* "Hello World" remains unreferenced to any object and lost in the pool as s2.concat() operation (in line number 5) is not assigned to any object. That's why there is a reference to its result.
+* String newS3 refers to the instance of s3.concat() operation that is "Hello Scaler" as it is referenced to new object newS3.
+
+**Hence, Strings are immutable and whenever we change the string only its reference is changed to the new instance.**
+
diff --git a/Academy DSA Typed Notes/Intermediate/Intermediate DSA Time Complexity.md b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Time Complexity.md
new file mode 100644
index 0000000..4596399
--- /dev/null
+++ b/Academy DSA Typed Notes/Intermediate/Intermediate DSA Time Complexity.md
@@ -0,0 +1,565 @@
+# Time Complexity
+
+**Topics covered :**
+
+1. Log Basics + Iteration Problems
+2. Comparing Iterations using Graph
+3. Time Complexity - Definition and Notations (Asymptotic Analysis - Big O)
+6. TLE
+7. Importance of Constraints
+
+:::success
+There are a lot of quizzes in this session, please take some time to think about the solution on your own before reading further.....
+:::
+
+## Basics of Logarithm
+
+Q. What is the meaning of LOG ?
+A. Logarithm is the inverse of exponential function.
+
+
+Q. How to read the statement "logb(a)"?
+A. To what value we need to raise b, such that we get a.
+
+If logb(a) = c, then it means bc = a.
+
+**Examples**
+
+1. log2(64) = 6
+**How?** 2 raise to the power what is 64? It's 6 since 26 = 64
+
+2. log3(27) = 3
+3. log5(25) = 2
+4. log2(32) = 5
+
+Now, calculate the floor values of the following logarithms.
+5. log2(10) = 3
+6. log2(40) = 5
+
+**Note:**
+If 2k = N => log2(N) = k
+
+Let's look at one more formula:
+1. What is log2(2^6)?
+A. 6
+Explanation: To what power you should raise 2, such that it equates to 2^6.
+
+2. What is log3(3^5)?
+A. 5
+Explanation: To what power you should raise 3, such that it equates to 3^5.
+
+**Note:**
+In general, loga(a^N) = N
+
+**Question**:
+
+Given a positive integer N, how many times do we need to divide it by 2 (Consider only integer part) until it reaches 1.
+
+For example, N = 100
+100 -> 50 -> 25 -> 12 -> 6 -> 3 -> 1
+Hence, 6 times.
+
+What if N = 324?
+324 -> 162 -> 81 -> 40 -> 20 -> 10 -> 5 -> 2 -> 1
+Hence, 8 times.
+
+
+### **Question**
+How many times we need to divide 9 by 2 till it reaches 1 ?
+
+**Choices**
+- [ ] 4
+- [x] 3
+- [ ] 5
+- [ ] 2
+
+**Explanation:**
+N --> N/2 --> N/4 --> N/8 --> ...... 1
+N/2^0 --> N/2^1 --> N/2^2 --> N/2^3 --> ...... N/2^K
+
+N/2^K = 1
+K = log2(N)
+
+### **Question**
+How many times we need to divide 27 by 2 till reaches 1 ?
+
+**Choices**
+- [ ] 5
+- [x] 4
+- [ ] 3
+- [ ] 6 -->
+
+
+
+### **Question**
+How many iterations will be there in this loop ?
+```pseudocode
+N > 0
+i = N;
+while (i > 1) {
+ i = i / 2;
+}
+```
+
+**Choices**
+- [ ] N
+- [ ] N/2
+- [ ] sqrt(N)
+- [x] log(N)
+
+
+
+**Explanation:**
+
+The given loop starts with the initial value of i as N and continues until i becomes less than or equal to 1, by repeatedly dividing i by 2 in each iteration.
+
+Hence, Iterations are log(N)
+
+
+### **Question**
+How many iterations will be there in this loop
+```
+for(i=1; i=0
+for(i=0; i<=N; i = i*2)
+{
+ ...
+}
+```
+
+**Choices**
+- [x] Infinite
+- [ ] N/2
+- [ ] 0
+- [ ] log(N)
+
+
+
+
+
+
+### Question
+How many iterations will be there in this loop
+```
+for(i=1; i<=10; i++){
+ for(j=1; j<=N; j++){
+ / ......../
+ }
+}
+```
+
+**Choices**
+- [ ] N + N
+- [ ] N^2
+- [x] 10 * N
+- [ ] N + 10
+
+
+
+> Multiplying the loops each time might not be correct. In this case, it works.
+
+
+
+
+### **Question**
+How many iterations will be there in this loop
+```
+for(i=1; i<=N; i++){
+ for(j=1; j<=N; j++){
+ ...
+ }
+}
+```
+
+**Choices**
+- [ ] 2 * N
+- [x] N * N
+- [ ] 10 * N
+- [ ] N * sqrt(N)
+
+
+**Explanation:**
+
+The given loop consists of two nested loops. The outer loop iterates from i=1 to i=N, and the inner loop iterates from j=1 to j=N.
+
+For each value of i in the outer loop, the inner loop will iterate N times. This means that for every single iteration of the outer loop, the inner loop will iterate N times.
+
+Therefore, the correct answer is N * N.
+
+
+
+### **Question**
+How many iterations will be there in this loop
+```
+for(i=1; i <= N; i++){
+ for(j=1; j <= N; j = j*2){
+ ...
+ }
+}
+```
+
+**Choices**
+- [ ] (N^2 + 2N + 1)/2
+- [x] N * log(N)
+- [ ] N^2
+- [ ] N(N+1)/2
+
+
+**Explanation:**
+
+The given loop consists of two nested loops. The outer loop iterates from i=1 to i <= N, and the inner loop iterates from j=1 to j <= N, with j being incremented by a power of 2 in each iteration.
+
+For each value of i in the outer loop, the inner loop iterates in powers of 2 for j. This means that the inner loop will iterate for j=1, 2, 4, 8,... up to the largest power of 2 less than or equal to N, which is log2(N).
+
+Therefore, the correct answer is N * log2(N).
+
+
+### **Question**
+How many iterations will be there in this loop ?
+```
+for(i = 1; i <= 4; i++) {
+ for(j = 1; j <= i ; j++) {
+ //print(i+j)
+ }
+}
+```
+**Choices**
+- [ ] log(N)
+- [ ] 2N
+- [x] 10
+- [ ] N -->
+
+
+### **Question**
+How many Iterations will be there in this loop ?
+```
+for(i = 1; i <= N; i++) {
+ for(j = 1; j <= i ; j++) {
+ //print(i+j)
+ }
+}
+```
+
+**Choices**
+- [ ] log(N)
+- [x] N*(N+1)/2
+- [ ] (N-1)/2
+- [ ] N/2
+
+
+### **Question**
+How many iterations will be there in this loop
+```
+for(i=1; i<=N; i++){
+ for(j=1; j<=(2^i); j++)
+ {
+ ...
+ }
+}
+```
+
+**Choices**
+- [ ] 2^N
+- [x] 2 * (2^N - 1)
+- [ ] 2 * (2N)
+- [ ] infinite
+
+
+This is GP, where a=2, r=2 and no. of terms are N.
+
+
+Consider two algorithms Algo1 and Algo2 given by Kushal and Ishani respectively.
+
+Considering **N** to be the size of the input:
+
+Algo|Number of Iterations
+-|-
+Algo1|100 * log(N)
+Algo2|N / 10
+
+Now, see the graph of the two algorithms based on N.
+
+Graphs info:
+
+* X-axis plots N (input size)
+* Red line (Algo 1): **100 * log(N)**
+* Blue line (Algo 2): **N/10**
+
+
+
+### Observations:
+Assuming both graphs intersect at N = 3500, let's draw some observations.
+
+For small input (N <= 3500), Ishani's algorithm performed better.
+For large input (N > 3500), Kushal's algorithm performed better.
+
+**In today's world data is huge**
+* IndiaVSPak match viewership was **18M**.
+* Baby Shark video has **2.8B** views.
+
+Therefore, Kushal's algorithm won since it has lesser iterations for huge data value.
+
+*We use **Asymptotic Analysis** to estimate the performance of an Algorithm when Input is huge.*
+
+
+**Asymptotic Analysis** OR **Big(O)** simply means analysing perfomance of algorithms for **larger inputs**.
+
+### Calculation of Big(O)
+**Steps** for **Big O** calculation are as follows:
+
+* Calculate **Iterations** based on **Input Size**
+* Ignore **Lower Order Terms**
+* Ignore **Constant Coefficients**
+
+**Example-**
+Kushal's algo took **100 * log2N** iterations: Big O is **O(log2N)**
+Ishani's algo took **N / 10** iterations: Big O is **O(N)**
+
+
+
+**For example**,
+1. Iterations: 4N^2 + 3N + 1
+2. Neglect lower order term: 3N + 1; Remaining Term: 4N^2
+3. Neglect constant 4
+
+Big O is O(N^2)
+
+### Comparsion Order:
+
+log(N) < sqrt(N) < N < N log(N) < N sqrt(N) < N^2 < N^3 < 2^(N) < N! < N^N
+
+**Using an example**
+N = 36
+5 < 6 < 36 < 36\*5 < 36\*6 < 362 < 363 < 236 < 36! < 3636
+
+**Ques:** What is the big notation time complexity of the following expression?
+4N^2 + 3N + 6 sqrt(N) + 9 log_2(N) + 10
+Ans = O(N^2)
+
+
+### Question
+F(N) = 4N + 3Nlog(N) + 1
+O(F(N)) = ?
+
+**Choices**
+- [ ] N
+- [x] N * logN
+- [ ] Constant
+- [ ] N^2
+
+
+
+### Question
+F(N) = 4NlogN + 3NSqrt(N) + 10^6
+O(F(N)) = ?
+
+**Choices**
+- [ ] N
+- [ ] N * logN
+- [ ] N^2
+- [x] N * Sqrt(N)
+
+## Why do we neglect Lower Order Terms
+
+Let's say the number of Iterations of an Algorithm are: N2+10N
+
+N|Total Iterations = N2+10N|Lower Order Term = 10N|% of 10N in total iterations = 10N/(N2+10N)*100
+-|-|-|-
+10|200|100|50%
+100|104+103|103|Close to 9%
+10000|108+105|105|0.1%
+
+## Conclusion
+We can say that, as the **Input Size** increases, the contribution of **Lower Order Terms** decreases.
+
+### Why do we neglect Constant Coefficients
+
+
+When the comparison is on very larger input sizes, the constants do not matter after a certain point. For example,
+
+
+| Algo 1(Nikhil)|Algo 2(Pooja)|Winner for Larger Input|
+| -------- | -------- | -------- |
+| 10 * log2 N | N | Nikhil |
+| 100 * log2 N | N | Nikhil |
+| 9 * N | N2 | Nikhil |
+| 10 * N | N2 / 10| Nikhil |
+| N * log2 N | 100 * N | Pooja |
+
+
+## Issues with Big(O)
+
+### Issue 1
+**We cannot always say that one algorithm will always be better than the other algorithm.**
+
+**Example:**
+* Algo1 (Iterations: 103 N) -> Big O: O(N)
+* Algo2 (Iterations: N2) -> Big O: O(N2)
+* Algo 1 is better than Algo 2 but only for large inputs, not for small input sizes.
+
+
+
+|Input Size (N)| Algo 1 (103) | Algo 2 (N2) | Optimised|
+| --| --| --| --|
+|N = 10| 104| 102|Algo 2|
+|N = 100| 105| 104|Algo 2|
+|N = 103| 106| 106|Both are same|
+|N = 103 + 1| (103)*(103 + 1)| (103 + 1)*(103 + 1)|Algo 1|
+|N = 104| 107| 108|Algo 1|
+
+**Claim:** For all large inputs >= 1000, Algo 1 will perform better than Algo 2.
+
+### Issue 2
+If 2 algorithms have same higher order terms, then Big O is not capable to identify algorithm with higher iterations.
+
+Consider the following questions -
+Count the number of odd elements from 1 to N
+
+Code 1: Iterations: N
+```pseudocode
+for (int i = 1; i <= N; i++) {
+ if (i % 2 != 0) {
+ c = c + 1;
+ }
+}
+```
+
+
+Code 2: Iterations: N/2
+```pseudocode
+for (int i = 1; i <= N; i = i + 2) {
+ c = c + 1;
+}
+```
+
+In both, Big O is O(N) but we know second code is better.
+
+
+## Time Limit Exceeded Error
+
+
+* **Is it necessary to write the entire code and then test it to determine its correctness?**
+* **Can we assess the logic's viability before writing any code?**
+
+
+### Online Editors and Why TLE occurs
+* Codes are executed on online servers of various platforms such as Codechef, Codeforces, etc.
+* The **processing speed** of their server machines is **1 GHz** which means they can perform **109 instructions** per second.
+* Generally, **codes should be executed in 1 second**.
+
+Using this information, we can say at max our code should have at most **109 instructions**.
+
+Instructions means any single operation such as multiplication, addition, function calling, single variable declaration, etc.
+
+### Question
+
+Consider the following code:
+
+Find the total number of instructions in the code below (Note that the instructions involved in the loop part are repetitive)
+
+
+
+**Conclusion:**
+Calculating Instructions is tedious job, rather we can make certain approximations in terms of number of Iterations.
+
+### Approximation 1
+Suppose the **code** has as small as **10 Instructions in 1 Iteration**.
+
+Therefore,
+| Instructions | Iterations |
+| -------- | -------- |
+| 10 | 1 |
+| 10^9 | 10^8 |
+
+In **1 sec**, we can have at max **109 Instructions** or **108 Iterations**, provided there are **10 Instructions / Iteration**.
+
+
+### Approximation 2
+Suppose the **code** has as huge as **100 Instructions in 1 Iteration**.
+
+Therefore,
+| Instructions | Iterations |
+| -------- | -------- |
+| 100 | 1 |
+| 10^9 | 10^7 |
+
+In **1 sec**, we can have at max **109 Instructions** or **107 Iterations**, provided there are **100 Instructions / Iteration**.
+
+### Conclusion:
+In general, our code can have **107** to **108 Iterations** to be able to run in **1 sec**.
+
+## General Structure to solve a question
+
+### How to approach a problem?
+
+* Read the **Question** and **Constraints** carefully.
+* Formulate an **Idea** or **Logic**.
+* Verify the **Correctness** of the Logic.
+* Mentally develop a **Pseudocode** or rough **Idea of Loops**.
+* Determine the **Time Complexity** based on the Pseudocode.
+* Assess if the time complexity is feasible and won't result in **Time Limit Exceeded (TLE)** errors.
+* **Re-evaluate** the **Idea/Logic** if the time constraints are not met; otherwise, proceed.
+* **Code** the idea if it is deemed feasible.
+
+
+### Importance of Constraints
+
+
+#### Question
+
+If 1 <= N <= 105,
+then which of the following Big O will work ?
+
+
+
+| Complexity | Iterations | Works ? |
+| -------- | -------- | -------- |
+| O(N3) | (105)3 | No |
+| O(N2) log N | (1010)*log 105 | No |
+| O(N2) | (105)2 | No |
+| O(N * log N) | (105)*log 105 | Yes |
+
+
+#### Question
+
+If 1 <= N <= 106,
+then which of the following Big O will work ?
+
+| Complexity | Iterations | Works ? |
+| -------- | -------- | -------- |
+| O(N3) | (106)3 | No |
+| O(N2) log N | (1012)*log 106 | No |
+| O(N2) | (1012) | No |
+| O(N * log N) | (106)*log 106 ~ 107 | May Be |
+| O(N) | (106) | Yes |
+
+
+#### Question
+
+If constraints are
+1 <= N <= 100, N3 will also pass.
+
+If constraints are
+1 <= N <= 20, 2N will also pass.
+
+**Note:**
+In Online Assessments, if we are not getting any other approach to a problem, try out the code; it may pass some test cases, which is better than nothing.
+
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher 1D Arrays.md b/Academy DSA Typed Notes/Java Refresher/Refresher 1D Arrays.md
new file mode 100644
index 0000000..bc0299c
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher 1D Arrays.md
@@ -0,0 +1,315 @@
+# Refresher : 1D Arrays
+# Introduction To Arrays
+
+---
+## Definition
+
+Array is the sequential collection of same types of data. The datatype can be of any type i.e, int, float, char, etc. Below is the declaration of the array:
+```java
+int arr[] = new int[5];
+```
+It can also be declared as:
+```java
+int[] arr = new int[5]
+```
+Here, ‘int’ is the datatype, ‘arr’ is the name of the array and ‘n’ is the size of an array.
+We can access all the elements of the array as arr[0], arr[1] ….. arr[n-1].
+
+**Note:** Array indexing starts with 0.
+
+
+---
+### Question
+Maximum index of array of size N is ?
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] 1
+- [ ] 0
+- [x] N-1
+- [ ] N
+
+
+---
+### Question
+Given an array as arr = {3,4,1,5,1}. What is ths sum of all elements in the array?
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] 12
+- [ ] 13
+- [x] 14
+- [ ] 15
+
+
+---
+## Question 1
+
+Take an integer array **arr** of size **N** as input and print its sum.
+
+#### TestCase
+##### Input
+```java
+N = 5
+arr = {1,2,3,4,5}
+```
+##### Output
+```plaintext
+15
+```
+
+#### Explanation
+To calculate the sum of all the elements in the array, we need a variable say **sum** which is initially zero. Then iterate all the elements and adding them to **sum**.
+
+#### PseudoCode
+```java
+int sum = 0;
+for (int i = 0; i < n; i++) {
+ sum = sum + arr[i];
+}
+System.out.println("Sum is " + sum);
+```
+\
+---
+### Question
+Given an array as arr = {3,4,1,5,1}. Find the maximum element.
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] 3
+- [ ] 4
+- [x] 5
+- [ ] 1
+
+
+---
+## Question 2
+
+Take an integer array **arr** of size **N** as input and print its maximum element.
+
+#### TestCase
+##### Input
+```plaintext
+N = 5
+arr = {1,2,3,4,5}
+```
+##### Output
+```plaintext
+5
+```
+
+#### PseudoCode
+```java
+int maximum_element = 0;
+for (int i = 0; i < n; i++) {
+ if (maximum_element < arr[i]) maximum_element = arr[i];
+}
+system.out.println("Sum is " + maximum_element);
+```
+
+---
+### Question
+
+What will be the output of the above code with
+N = 5
+arr = {-3, -7, -2, -10, -1}
+array as input ?
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] -7
+- [ ] -1
+- [x] 0
+- [ ] 2
+
+**Explanation**
+
+Initially we have assumed 0 as the max element in the array and in the given case, all the element is smaller than 0. So, the max element is 0.
+
+---
+### Question 2 PseudoCode
+
+**Note:** We can fix it by initially assigning arr[0] to the maximum_element.
+So the updated pseudocode is:
+
+```java
+int maximum_element = arr[0];
+for (int i = 0; i < n; i++) {
+ if (maximum_element < arr[i]) maximum_element = arr[i];
+}
+system.out.println("Sum is " + maximum_element);
+```
+
+---
+## Question 3
+
+Take an integer array **arr** of size **N** as input and return its minimum element.
+
+#### TestCase
+##### Input
+```java
+N = 5
+arr = {1,2,3,4,5}
+```
+##### Output
+```plaintext
+1
+```
+
+#### PseudoCode
+```java
+public static int findMin(int arr[], int n) {
+ int minimum_element = arr[0];
+ for (int i = 0; i < n; i++) {
+ if (minimum_element > arr[i]) minimum_element = arr[i];
+ }
+ return minimum_element;
+}
+```
+
+---
+## Question 4
+Take an integer array **arr** of size **N** as input and check whether an integer **k** is present in that or not.
+
+#### TestCase
+##### Input
+```java
+N = 5
+arr = {1,2,3,4,5}
+k = 4
+```
+##### Output
+```plaintext
+true
+```
+
+#### Explanation
+To check whether an integer **k** is present in the array or not, we need to check each element and compare it with **k**. If none of the element is equal to **k**,then return false.
+
+#### PseudoCode
+```java
+public static boolean findK(int arr[], int n, int k) {
+ for (int i = 0; i < n; i++) {
+ if (arr[i] == k) return true;
+ }
+ return false;
+}
+```
+
+---
+### Question
+Given an array as arr = {3,4,1,5,1}. What is the frequency of 1?
+
+Frequency of any element is defined as the number of occurences of that element in the array.
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] 0
+- [ ] 1
+- [x] 2
+- [ ] 3
+
+---
+## Question 5
+
+Take an integer array **arr** of size **N** as input. Return the frequency of **K** in the array.
+
+#### TestCase
+
+##### Input
+```java
+N = 6
+arr = {1,2,3,4,5,1}
+k = 1
+```
+##### Output
+```plaintext
+2
+```
+
+
+**Note:** Here frequency is the number of times the element **k** occurs in the array.
+
+#### PseudoCode
+```java
+public static int frequencyK(int arr[], int n, int k) {
+ int frequency = 0;
+ for (int i = 0; i < n; i++) {
+ if (arr[i] == k) frequency++;
+ }
+ return frequency;
+}
+```
+
+
+---
+## Question 6
+
+Given an integer array as an input, return the frequency count of the array.
+
+#### TestCase
+##### Input
+```java
+arr = {1,1,2,1,3,1,3}
+```
+##### Output
+```plaintext
+{4,4,1,4,2,4,2}
+```
+
+#### PseudoCode
+```java
+int[] frecount(int arr[]) {
+ int n = arr.length;
+ int[] ans = new int[n];
+ for (int i = 0; i < n; i++) {
+ ans[i] = frequencyK(arr, n, arr[i]);
+ }
+ return ans;
+}
+```
+
+
+---
+## Question 7
+
+Given an integer array as an input, check whether it is strictly increasing.
+
+
+#### TestCase
+##### Input
+```plaintext
+N = 5
+arr = {1,2,3,4,5}
+```
+##### Output
+```plaintext
+true
+```
+##### Explanation
+All the element in the array is in sorted order. So, we can say that it is in strictly increasing order.
+As
+```plaintext
+1 < 2 < 3 < 4 < 5
+```
+
+#### PseudoCode
+```java
+public static boolean strictlyincreasing(int arr[]) {
+ int n = arr.length;
+ for (int i = 0; i < n - 1; i++) {
+ if (arr[i] >= arr[i + 1]) return false;
+ }
+ return true;
+}
+```
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher 2D Arrays.md b/Academy DSA Typed Notes/Java Refresher/Refresher 2D Arrays.md
new file mode 100644
index 0000000..0c2bc41
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher 2D Arrays.md
@@ -0,0 +1,445 @@
+# Refresher : 2D Arrays
+
+
+
+# 2D Arrays
+- Store similar types of items
+- Sequential storage of elements
+- It has both length and breadth
+
+## Real-Time Application Example of 2D Arrays
+- Chess
+- Theatre Seats
+- Bus
+- Egg Tray
+- Tic Toe Game
+
+## Syntax
+
+```cpp
+int mat[][] = new int[row][col];
+```
+In 2D arrays, we have square brackets in the declaration but in the 1D array we use one square bracket to declare it(`int[] ar=new int[]`) and in 2D matrix declaration first bracket is used to specify the number of rows and second is for the number of columns.
+
+
+
+||||Rows||
+|-|-| -------- | -------- | -------- |
+|| |↓ |↓ |↓ |
+||→|**-**|**-**|**-**|
+|**Columns**|→|**-**|**-**|**-**|
+||→|**-**|**-**|**-**|
+
+In the above matrix, we have 3 rows and 3 columns.
+
+
+## Example
+|-|-|-|-|
+|-|-|-|-|
+|**-**|**-**|**-**|**-**|
+|**-**|**-**|**-**|**-**|
+
+In the above matrix, we have 3 rows and 4 columns, and we can declare it by writing `int[][] mat = new int[3][4]`.
+
+Here also zero-based indexing works,
+
+| **Col** | 0 | 1 | 2 | 3 |
+|:--------------:|:-----:|:-----:|:-----:|:-----:|
+| **Row:** **0** | **-** | **-** | **-** | - |
+| **1** | **-** | **-** | **-** | **-** |
+| **2** | **-** | **-** | **-** | **-** |
+
+## How a particular cell is represented in a matrix
+Every cell is represented in the form mat[rowNo][colNo]
+
+
+| **Col** | 0 | 1 | 2 | 3 |
+|:--------------:|:---------:|:---------:|:---------:|:---------:|
+| **Row:** **0** | mat[0][0] | mat[0][1] | mat[0][2] | mat[0][3] |
+| **1** | mat[1][0] | mat[1][1] | mat[1][2] | mat[1][3] |
+| **2** | mat[2][0] | mat[2][1] | mat[2][2] | mat[2][3] |
+
+
+
+---
+### Question
+
+How to create a matrix with 5 columns and 7 rows?
+
+**Choices**
+
+- [ ] int[][] mat = new int[5][7];
+- [x] int[][] mat = new int[7][5];
+- [ ] int[] mat = new int[5][7];
+
+
+---
+### Question
+
+If you have a matrix of size M * N, what is the index of the top left corner?
+
+**Choices**
+
+- [ ] [top][left]
+- [ ] [0][N - 1]
+- [x] [0][0]
+- [ ] [M - 1][N - 1]
+
+---
+### Question
+
+If you have a matrix of size M * N, what is the index of the bottom right corner?
+
+**Choices**
+
+- [ ] [bottom][right]
+- [ ] [0][M - 1]
+- [ ] [N - 1][M - 1]
+- [x] [M - 1][N - 1]
+
+
+
+---
+## Print the top row of a matrix
+
+Given a matrix of size N * M, print its top row.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Solution
+ Coordinates of the first row of the matrix are: (0,0), (0,1), (0,2), _ _ _ , (0, M - 1).
+
+ Here column Number keeps on changing from 0 to M - 1 and row Number is always 0.
+
+### Pseudocode
+```cpp
+for(int col = 0; i < M; i++){
+ print(mat[0][i]);
+}
+```
+
+
+---
+## Print the leftmost column of a matrix
+
+
+### Problem Statement
+Given a matrix of size N * M, print its leftmost column.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Solution
+ Coordinates of the leftmost column of the matrix are:
+ (0,0),
+(1,0),
+(2,0),
+_ ,
+_ ,
+_ ,
+(N-1,0).
+
+ Here row Number keeps on changing from 0 to N - 1 and the column Number is always 0.
+
+### Pseudocode
+```cpp
+for(int row = 0; row < N; row++){
+ print(mat[row][0]);
+}
+```
+
+---
+## Print matrix row by row
+
+
+
+### Problem Statement
+Given a matrix of size N * M, print row by row
+
+### Understanding the problem statement
+We have to print every row of the matrix one by one, first print the elements of the first row then print the next line character, then print its second-row elements and then again the next line character, and so on till the last row, in this way we have to print all the rows one by one.
+
+
+### Pseudocode
+```cpp
+for(int row = 0; row < N; row++){
+ for(int col = 0; col < M; col++){
+ print(mat[row][col]);
+ }
+ print("\n");
+}
+```
+
+---
+## Print matrix column by column
+
+### Problem Statement
+Given a matrix of size N * M, print column by column
+
+### Example
+**Input:**
+
+| **Col** | 0 | 1 | 2 |
+|:--------------:|:---:|:---:|:---:|
+| **Row:** **0** | 1 | 3 | -2 |
+| **1** | 9 | 0 | 8 |
+
+
+
+**Output:**
+1 9
+3 0
+-2 8
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+## Pseudocode
+```cpp
+for(int col = 0; col < M; col++){
+ for(int row = 0; row < N; row++){
+ print(mat[row][col]);
+ }
+ print("\n");
+}
+```
+
+
+---
+## Matrix coding practice
+
+
+### Java Code for printing matrix row by row and column by column
+
+```java
+import java.util.*;
+public class Main {
+ public static void printRowByRow(int mat[][]) {
+ int n = mat.length; // rows
+ int m = mat[0].length; // cols
+ for (int row = 0; row < n; row++) {
+ for (int col = 0; col < m; col++) {
+ System.out.print(mat[row][col] + " ");
+ }
+ System.out.println();
+ }
+ System.out.println("-----------------------------");
+ }
+
+ public static void printColByCol(int mat[][]) {
+ int n = mat.length; // rows
+ int m = mat[0].length; // cols
+ for (int col = 0; col < m; col++) {
+ for (int row = 0; row < n; row++) {
+ System.out.print(mat[row][col] + " ");
+ }
+ System.out.println();
+ }
+ System.out.println("-----------------------------");
+ }
+
+ public static void main(String[] args) {
+ Scanner scn = new Scanner(System.in);
+ int n = scn.nextInt();
+ int m = scn.nextInt();
+ int[][] mat = new int[n][m];
+ for (int row = 0; row < n; row++) {
+ for (int col = 0; col < m; col++) {
+ mat[row][col] = scn.nextInt();
+ }
+ }
+ printRowByRow(mat);
+ printColByCol(mat);
+ }
+}
+```
+
+
+---
+## Sum of matrix
+
+
+### Problem statement
+Given a matrix of size N * M as an argument, return its sum.
+
+### Example:
+**Input**
+||||
+|-|-|-|
+|1|3|-2|
+|9|0|8|
+
+**Output:**
+19
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### PseudoCode
+```java
+public static int sum(int mat[][]) {
+ int n = mat.length; // rows
+ int m = mat[0].length; // cols
+ int sum = 0;
+ for (int row = 0; row < n; row++) {
+ for (int col = 0; col < m; col++) {
+ sum = sum + mat[row][col];
+ }
+ }
+ return sum;
+}
+```
+
+
+
+---
+## Waveform printing
+
+### Problem statement
+Given a matrix of size N * M as an argument, print it in waveform.
+
+### Example:
+**Input**
+|||||
+|-|-|-|-|
+|1|3|-2|7|
+|9|0|8|-1|
+|5|6|-2|3|
+|3|4|0|2|
+
+**Output:**
+1 3 -2 7
+-1 8 0 9
+5 6 -2 3
+2 0 4 3
+
+### Understanding the problem statement
+Waveform printing, you have to print the first row of the matrix as it is, then print the second row in reverse order, then print the third row as it is, then print the fourth row in reverse order and so on, in this way, you have to print all the rows of the matrix.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Approach
+If the row number of a matrix is even then we have to print as it is, if the row number is odd then we have to print in reverse order.
+
+### PseudoCode
+```java
+public static void wavePrint(int mat[][]) {
+ int n = mat.length; // rows
+ int m = mat[0].length; // cols
+ for (int row = 0; row < n; row++) {
+ if(row%2==0){
+ for (int col = 0; col < m; col++) {
+ System.out.print(mat[row][col]+" ");
+ }
+ }
+ else{
+ for (int col = m - 1; col >= 0; col--) {
+ System.out.print(mat[row][col]+" ");
+ }
+ }
+ System.out.println();
+ }
+}
+```
+
+---
+## Row wise sum
+
+
+### Problem statement
+Given a matrix of size N * M as an argument, return a row-wise sum.
+
+### Example:
+
+|||||
+|-|-|-|-|
+|1|3|-2|7|
+|9|0|8|-1|
+|5|6|-2|3|
+
+**Output:**
+[9, 16, 12]
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Understanding the problem statement
+Return the sum of every row in the form of an array.
+
+
+### PseudoCode
+```java
+public static int[] rowWiseSum(int mat[][]) {
+ int n = mat.length; // rows
+ int m = mat[0].length; // cols
+ int[] ans = new int[n];
+ for (int row = 0; row < n; row++) {
+ int sum=0;
+ for (int col = 0; col < m; col++) {
+ sum = sum + mat[row][col];
+ }
+ ans[row] = sum;
+ }
+ return ans;
+}
+```
+
+
+---
+## Column-wise max
+
+
+### Problem statement
+Given a matrix of size N * M as an argument, return col-wise max.
+
+### Example:
+
+|||||
+|-|-|-|-|
+|1|3|-2|7|
+|9|0|8|-1|
+|5|6|-2|3|
+
+**Output:**
+[9, 6, 8, 7]
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Understanding the problem statement
+Return a maximum of every column in the form of an array.
+
+
+### PseudoCode
+```java
+public static int[] colWiseMax(int mat[][]) {
+ int n = mat.length; // rows
+ int m = mat[0].length; // cols
+ int[] ans = new int[m];
+ for (int col = 0; col < m; col++) {
+ int max = mat[0][col];
+ for (int row = 0; row < n; row++) {
+ if(mat[row][col] > max){
+ max = mat[row][col];
+ }
+ }
+ ans[col] = max;
+ }
+ return ans;
+}
+```
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher Arraylists.md b/Academy DSA Typed Notes/Java Refresher/Refresher Arraylists.md
new file mode 100644
index 0000000..ca7f12c
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher Arraylists.md
@@ -0,0 +1,423 @@
+# Refresher: Arraylists
+
+# Arrays
+Arrays have some disadvantages:
+- Fixed-size(we cannot increase or decrease size of array)
+- Size should be known in advance.
+
+Due to these arrays are not suitable for some situations.
+
+
+---
+## ArrayList
+ArrayList have all the advantages of arrays with some additional features
+- Dynamic size
+- Does not require to know the size in advance.
+
+
+## Examples
+Here are some real-world examples where using an ArrayList is preferred in comparison to using arrays.
+
+- Shopping list
+- New tabs of the browser
+- Youtube playlist
+
+
+## Syntax
+```java
+ArrayList arr = new ArrayList();
+```
+- Here Type has to be a class, it can not be a primitive.
+- Primitives can be int, long, double, or boolean.
+- Instead of primitives we can use wrapper classes and custom objects, which means we can use Integer, Long, Double, String, etc.
+
+---
+## Basic Operations
+
+### Inserting element
+We can add an element in the arraylist using `add()` and it adds an element at the end of the list.
+
+### Get
+It will fetch elements from the ArrayList using an index.
+
+### Size
+`size()` will give us the size of the ArrayList.
+
+### Remove
+It removes the element from the ArrayList present at a particular index.
+
+### Set
+It updates the value of a particular index to the new value.
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void main(String args[]){
+ ArrayList arr = new ArrayList();
+
+ //printing ArrayList
+ System.out.println(arr);
+
+ // add
+ arr.add(2);
+ arr.add(-1);
+ arr.add(5);
+
+
+ System.out.println(arr);
+
+ //get
+ System.out.println("2nd element is: "+arr.get(2));
+ // System.out.println(arr.get(-1)); it gives an error as the -1 index does not exist for arr
+ // System.out.println(arr.get(3)); it gives an error as 3 index does not exist for arr
+
+
+ // Size
+ System.out.println("Size is: " + arr.size());
+
+ // Remove
+ arr.remove(1);
+ System.out.println(arr);
+
+
+ // Set
+ arr.set(1, 8);
+ System.out.println(arr);
+ }
+}
+```
+
+**Output**
+
+```plaintext
+[]
+[2, -1, 5]
+2nd element is: 5
+Size is: 3
+[2, 5]
+[2, 8]
+```
+
+---
+# Taking Arraylist as an input
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void main(String args[]){
+ Scanner sc = new Scanner(System.in);
+
+
+ // Taking ArrayList as input
+ ArrayList arr = new ArrayList();
+
+ int n = sc.nextInt();
+ for(int i = 0 ; i < n ; i++){
+ int tmp = sc.nextInt();
+ arr.add(tmp);
+ }
+ System.out.println(arr);
+ }
+}
+```
+
+
+---
+## Problem Statement
+Given an ArrayList as input, return an ArrayList of the multiples of 5 or 7.
+
+## Example
+**Input:** [1, 5, 3, 0, 7]
+**Output:** [5, 0, 7]
+
+## Solution
+Iterate over the input ArrayList, and check if the element is divisible by 5 or 7 then simply add it to the result ArrayList.
+
+## PsuedoCode
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static ArrayList multiples(ArrayList arr){
+ ArrayList ans = new ArrayList();
+ for(int i = 0; i < arr.size(); i++){
+ int val = arr.get(i);
+ if(val % 5 == 0 || val % 7 == 0)
+ ans.add(val);
+ }
+ return ans;
+ }
+ public static void main(String args[]){
+ Scanner sc = new Scanner(System.in);
+
+
+ // Taking ArrayList as input
+ ArrayList arr = new ArrayList();
+
+ int n = sc.nextInt();
+ for(int i = 0 ; i < n ; i++){
+ int tmp = sc.nextInt();
+ arr.add(tmp);
+ }
+ System.out.println(multiples(arr));
+ }
+}
+```
+
+
+
+---
+## Problem Statement
+Given two integers A and B as input, return an ArrayList containing first B multiples of A.
+
+## Example
+**Input:** A = 2, B = 4
+**Output:** [2, 4, 6, 8]
+
+**Explanation:** First four multiple of 2 are A * 1 = 2 * 1 = 2, A * 2 = 2 * 2 = 4, A * 3 = 2 * 3 = 6, A * 4 = 2 * 4 = 8
+
+
+
+## PsuedoCode
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static ArrayList firstB(int A, int B){
+ ArrayList ans = new ArrayList();
+ for(int i = 1; i <= B; i++){
+ ans.add(A * i);
+ }
+ return ans;
+ }
+ public static void main(String args[]){
+
+ System.out.println(firstB(3, 5));
+ }
+}
+```
+
+**Output:**
+```plaintext
+[3, 6, 9, 12, 15]
+```
+
+
+---
+# 2D Arrays
+
+We can imagine 2D arrays as array of arrays.
+
+## 2D ArrayList
+2D ArrayList are ArrayList of ArrayLists
+
+
+## Syntax
+```java
+ArrayList< ArrayList > mat = new ArrayList< ArrayList >();
+```
+
+## Basic Operations
+- **Add:** We can add ArrayList inside 2D ArrayList. We can ArrayLists of different sizes in a single 2D ArrayList.
+- Get
+- Size
+- Remove
+- Set
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void main(String args[]){
+ ArrayList< ArrayList > list2d = new ArrayList< ArrayList >();
+
+ // Add
+ ArrayList a1 = new ArrayList();
+ a1.add(1);
+ a1.add(4);
+ list2d.add(a1);
+
+
+ ArrayList a2 = new ArrayList();
+ a2.add(0);
+ list2d.add(a2);
+
+ ArrayList a3 = new ArrayList();
+ a3.add(10);
+ a3.add(-5);
+ a3.add(1);
+ list2d.add(a3);
+
+ System.out.println(list2d);
+
+
+ // Get
+ System.out.println(list2d.get(0));
+ System.out.println(list2d.get(2).get(1));
+
+
+ // Size
+ System.out.println(list2d.size());
+ System.out.println(list2d.get(1).size());
+
+
+ // Remove
+ list2d.remove(1);
+ System.out.println(list2d);
+
+
+ // Set
+ ArrayList a4 = new ArrayList();
+ a4.add(-2);
+ a4.add(5);
+ a4.add(8);
+ list2d.set(0,a4);
+ System.out.println(list2d);
+
+
+ // Update a list element
+ list2d.get(1).set(1, -15);
+ System.out.println(list2d);
+ }
+}
+
+```
+
+**Output:**
+```plaintext
+[[1, 4], [0], [10, -5, 1]]
+[1, 4]
+-5
+3
+1
+[[1, 4], [10, -5, 1]]
+[[-2, 5, 8], [10, -5, 1]]
+[[-2, 5, 8], [10, -15, 1]]
+```
+
+
+
+---
+## Problem Statement
+Given a 2D Arraylist as input, print it line by line.
+
+## Explanation
+Every nested list of 2D ArrayList is to be printed in different lines and the elements in a single line are separated by space.
+
+## Example
+**Input:** [[1, 4], [0], [10, -5, 1]]
+**Output:**
+1 4
+0
+10 -5 1
+
+
+## Code
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void print2DList(ArrayList< ArrayList > list2d){
+ for(int i = 0 ; i < list2d.size() ; i++){
+ // get the ith ArrayList
+ ArrayList ls = list2d.get(i);
+
+ //Print the ith list
+ for(int j = 0 ; j < ls.size() ; j++){
+ System.out.print(ls.get(j) + " ");
+ }
+ System.out.println();
+ }
+ }
+ public static void main(String args[]){
+ ArrayList< ArrayList > list2d = new ArrayList< ArrayList >();
+
+ ArrayList a1 = new ArrayList();
+ a1.add(1);
+ a1.add(4);
+ list2d.add(a1);
+
+
+ ArrayList a2 = new ArrayList();
+ a2.add(0);
+ list2d.add(a2);
+
+ ArrayList a3 = new ArrayList();
+ a3.add(10);
+ a3.add(-5);
+ a3.add(1);
+ list2d.add(a3);
+
+
+ print2DList(list2d);
+ }
+}
+```
+
+**Output:**
+```plaintext
+1 4
+0
+10 -5 1
+```
+
+
+
+---
+## Problem Statement
+Given an integer N as input, return the numeric staircase.
+
+
+## Example
+**Input:** 3
+
+**Output:**
+```plaintext
+[
+ [1].
+ [1, 2],
+ [1, 2, 3]
+]
+```
+
+
+## Code
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static ArrayList< ArrayList > staircase(int N){
+ ArrayList< ArrayList > ans = new ArrayList< ArrayList >();
+
+ for(int row = 1 ; row <= N ; row++){
+ ArrayList rw = new ArrayList();
+ for(int col = 1 ; col <= row ; col++){
+ rw.add(col);
+ }
+ ans.add(rw);
+ }
+ return ans;
+ }
+ public static void main(String args[]){
+ System.out.println(staircase(3));
+ }
+}
+```
+
+**Output:**
+```plaintext
+[[1], [1, 2], [1, 2, 3]]
+```
+
+
+
+---
+# Some pointers
+
+- Use Java 8 Oracle JDK - Language
+- Gets easier with use
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher For Loop.md b/Academy DSA Typed Notes/Java Refresher/Refresher For Loop.md
new file mode 100644
index 0000000..7dc4ef5
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher For Loop.md
@@ -0,0 +1,525 @@
+# Refresher : For Loop
+
+---
+### Question
+
+```java
+// 1.
+while(// 2.) {
+// 3.
+// 4.
+}
+```
+
+Which sequence correctly represents the order of operations in the while loop?
+
+**Choices**
+
+- [ ] Initialisaton , Loop work, Condition , Update
+- [ ] Initialisation , update, Loop work , Condition
+- [x] Initialisation , Condition, Loop work, Update
+- [ ] Loop work, Initialisation, Condition, Update
+
+**Explanation:**
+
+* **Initialization:** In this step, the loop control variable is initialized to a starting value. It is usually the first step before the loop begins.
+* **Condition:** The loop condition is evaluated before each iteration. If the condition is true, the loop body will be executed; otherwise, the loop will terminate.
+* **Loop work:** This represents the actual code or operations that are executed inside the loop body during each iteration.
+* **Update:** After each iteration, the loop control variable is updated or modified. It prepares the loop for the next iteration by changing its value.
+
+So, the correct flow of the loop is Initialization -> Condition -> Loop work -> Update.
+
+---
+## For Loops
+
+The for loop in most programming languages follows the syntax given below:
+
+```java
+for(initialization; condition; update) {
+ loop work;
+}
+```
+
+The meaning of each step is same as while loop.
+For Loop and while can be used interchaneably. They are like Water and Jal.
+
+### Example-1:
+
+Given N as input, Print from 1 to N.
+
+Provided we have input N, this is how the `for` loop looks like:
+
+### Code:
+
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ System.out.print("Enter a number (N): ");
+ int N = scanner.nextInt();
+
+ for (int i = 1 ; i <= N; i ++ ) {
+ System.out.print(i + " ");
+ }
+
+ scanner.close();
+ }
+}
+```
+
+### Explanation
+
+* **Initialization:** `int i = 1`; - Firstly, we initialize i = 1. This sets the starting point for the loop.
+* **Condition:** `i <= N`; - Loop continues to execute till `i <= N`. In each iteration, it checks if i <= N. If it is true, the loop work is done; otherwise, the loop terminates.
+* **Loop Body (Action):** `System.out.print(i + " ");` - During each iteration, the loop body prints the value of i, followed by a space.
+* **Update:** `i ++` - After each iteration, i is incremented by 1. This prepares loop for next iteration.
+
+
+
+### Example-2:
+
+Given N as input, print all odd numbers from 1 to N.
+
+### Approach:
+* First, we take input from user.
+* Then we run the loop from 1 to N.
+* Since we want to print only odd numbers, we increment by 2 to skip even numbers.
+* The loop body prints the value of `i`
+
+
+### Code:
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ System.out.print("Enter a number (N): ");
+ int N = scanner.nextInt();
+
+ for (int i = 1; i <= N; i += 2) {
+ System.out.print(i + " ");
+ }
+
+ scanner.close();
+ }
+}
+```
+
+---
+## What are Factors of a Number
+
+**i** is said to be the factor of N if i divides N completely, i.e **N % i = 0**
+
+Let's take an Integer as an example and find its factors:
+
+**Example 1:** Find the factors of 6.
+Since 1, 2, 3, 6 divides 6 completely, hence factors of 6 are 1, 2, 3, and 6.
+
+**Example 2:** Find the factors of 10.
+Since 1, 2, 5, 10 divides 10 completely hence, the factors of 10 are 1, 2, 5, and 10.
+
+
+---
+### Question
+
+What are the factors of 24 ?
+
+**Choices**
+
+- [ ] 2, 3, 4, 6, 8, 12
+- [ ] 1, 2, 3, 4, 6, 8, 12
+- [x] 1, 2, 3, 4, 6, 8, 12, 24
+
+**Explanation**
+
+Factors of 24 are 1, 2, 3, 4, 6, 8, 12, and 24.
+
+---
+## Print the factors of a positive number N
+
+How to print the factors of a positive number N ?
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Approach:
+
+* The range of factors of a positive integer N is from 1 to N.
+* We can simply iterate from 1 to N to get all the factors
+* If N % i == 0, increment count variable.
+
+### Code:
+
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static void printFactors(int N) {
+ System.out.print("Factors of " + N + ": ");
+ for (int i = 1; i <= N; ++ i) {
+ if (N % i == 0) {
+ System.out.print(i + " ");
+ }
+ }
+ System.out.println();
+ }
+
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ System.out.print("Enter a number (N): ");
+ int N = scanner.nextInt();
+
+ printFactors(N);
+
+ scanner.close();
+ }
+}
+```
+
+---
+### Question
+
+Definition of Prime :
+If a number **"N"** is divisible by **1** and itself is called **Prime Number**.
+
+**Choices**
+
+- [ ] True
+- [x] False
+
+**Explanation:**
+
+As per above definition, 1 will also be a Prime Number since its factors are 1 and itself.
+But we know 1 is not a Prime Number, hence the definition is wrong.
+
+**Correct Definition:** A prime number has exactly two factors.
+
+**For example:**
+2 is a prime number because it has only two factors, 1 and 2.
+3 is a prime number because it has only two factors, 1 and 3.
+5 is a prime number because it has only two factors, 1 and 5.
+
+---
+## Prime Numbers
+
+### How to check if a number is prime or not?
+
+* We just need to check if N has exactly 2 factors, then it is Prime.
+* So, we can make use of previous code to get the factors of N and check if factors are 2 or not.
+
+### Code:
+
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static boolean isPrime(int number) {
+ int divisorCount = 0;
+
+ for (int i = 1; i <= number; ++ i) {
+ if (number % i == 0) {
+ divisorCount ++ ;
+ }
+ }
+
+ return (divisorCount == 2);
+ }
+
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ int divisorCount = 0;
+ System.out.print("Enter a number: ");
+ int N = scanner.nextInt();
+
+ for (int i = 1; i <= N; ++ i) {
+ if (N % i == 0) {
+ divisorCount ++ ;
+ }
+ }
+
+ if (isPrime(N)) {
+ System.out.println("Prime");
+ } else {
+ System.out.println("Not Prime");
+ }
+
+ scanner.close();
+ }
+}
+```
+
+---
+### Question
+
+What is the smallest prime number?
+
+**Choices**
+
+- [ ] 0
+- [ ] 1
+- [x] 2
+- [ ] 3
+
+**Explanation:**
+
+The smallest prime number is 2. Also, it is the only even prime number.
+
+---
+## Break and Continue statements
+
+### Explanation of Break statement
+
+The `break` statement is used to exit or terminate the nearest enclosing loop prematurely. When the `break` statement is encountered inside a loop, it immediately stops the loop's execution and transfers control to the statement following the loop. It helps avoid unnecessary iterations and is often used to terminate a loop early based on a specific condition.
+
+
+The code for finding if a number is prime or not can be modified using `break` statement to avoid more efforts
+
+In the given code, the goal is to check if the number N is prime or not. We can use the `break` statement to optimize the loop and avoid unnecessary iterations. The idea is that if we find any divisor of N, other than 1 and N, we can conclude that N is not prime, and there is no need to check further.
+
+Here's the modified code using the `break` statement:
+
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ System.out.print("Enter a number: ");
+ int N = scanner.nextInt();
+
+ int divisorCount = 0;
+ for (int i = 1; i <= N; i ++ ) {
+ if (N % i == 0) {
+ divisorCount ++ ;
+ if (divisorCount > 2) {
+ // If we find more than 2 divisors, break the loop
+ break;
+ }
+ }
+ }
+
+ if (divisorCount == 2) {
+ System.out.println(N + " is a prime number.");
+ } else {
+ System.out.println(N + " is not a prime number.");
+ }
+
+ scanner.close();
+ }
+}
+```
+
+* If `cnt` is greater than 2 (meaning N has more than two divisors), the break statement is used to terminate the loop early, avoiding unnecessary iterations.
+* After the loop, it checks if `cnt` is equal to 2. If `cnt` is exactly 2, it means N has exactly two divisors (1 and N), so it is prime.
+* Depending on the value of `cnt`, it prints either "Prime" or "Not Prime" on the screen.
+
+### Explaination of Continue statement
+
+The `continue` statement is used to skip the rest of the current iteration in a loop and move on to the next iteration immediately. When the `continue` statement is encountered inside a loop, it interrupts the current iteration's execution and starts the next iteration of the loop.
+
+We can use the continue statement to skip odd numbers and only print the even numbers between 1 and N.
+
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ System.out.print("Enter a number (N): ");
+ int N = scanner.nextInt();
+
+ System.out.print("Even numbers between 1 and " + N + ": ");
+ for (int i = 1; i <= N; ++ i) {
+ if (i % 2 != 0) {
+ // Skip odd numbers using continue statement
+ continue;
+ }
+ System.out.print(i + " ");
+ }
+ System.out.println();
+
+ scanner.close();
+ }
+}
+```
+
+* The code takes the input N from the user using `std::cin`.
+* It then enters a for loop that iterates from 1 to N.
+* Inside the loop, there is an if condition: `if (i % 2 != 0)`.
+* The condition checks if `i` is odd (i.e., not divisible by 2). If `i` is odd, the continue statement is executed, and the rest of the loop's body is skipped.
+* Therefore, when `i` is odd, the loop moves on to the next iteration, effectively skipping the odd numbers.
+* For all even values of i, the loop prints the even numbers between 1 and N, separated by spaces.
+
+---
+## How to Solve Questions with T Test Cases
+
+To solve questions with T test cases, you'll need to write a program that can handle multiple test cases. Typically, the input for each test case will be provided one after the other, and your program should process each test case and produce the corresponding output.
+
+Here's a general approach to handle T test cases in your program:
+
+* Read the value of T (the number of test cases) from the input.
+* Use a loop to iterate T times to process each test case.
+* For each test case, read the input data specific to that test case.
+* Perform the required operations or computations for that test case.
+* Output the result for that test case.
+* Repeat steps 3 to 5 until all T test cases are processed.
+
+Here's an example to illustrate the process:
+
+```java
+import java.util.Scanner;
+
+public class Main {
+ public static void main(String[] args) {
+ Scanner scanner = new Scanner(System.in);
+
+ System.out.print("Enter the number of test cases (T): ");
+ int T = scanner.nextInt();
+
+ for (int t = 1; t <= T; ++ t) {
+ // Read input data specific to the current test case
+ // For example, prompt the user to enter data for each test case
+ // int N = scanner.nextInt();
+ // String input = scanner.next();
+ // ...
+
+ // Perform computations or operations for the current test case
+ // For example, process the input data and calculate the result
+ // int result = processData(N, input);
+ // ...
+
+ // Output the result for the current test case
+ // For example, print the result for each test case
+ // System.out.println("Result for Test Case " + t + ": " + result);
+ // ...
+ }
+
+ scanner.close();
+ }
+}
+```
+
+---
+## Scope of Variables
+
+### Explanation
+The scope of a variable refers to the region of a program where that variable is accessible and can be used. It determines the portion of the code in which a variable exists and retains its value.
+
+```java
+import java.lang.*;
+import java.util.*;
+
+class Main {
+
+ // public static void main(String args[]) {
+
+ // // Scope of Variable
+ // // Useful lifetime of a variable
+
+ // int x = 10;
+ // //....
+ // //....
+ // //....
+ // System.out.println(x);
+ // //....
+ // //....
+ // } // closing of the parent bracket
+ // // Line 10-18 is the scope of the variable
+
+ public static void main(String args[]) {
+ // Case 1
+ // int x = 10;
+ // int y = 15;
+ // {
+ // System.out.println(x + " " + y);
+ // }
+
+ // Case 2
+ // int x = 10;
+ // {
+ // int y = 15;
+ // System.out.println(x + " " + y);
+ // }
+ // {
+ // System.out.println(x + " " + y);
+ // }
+
+ // Case 3
+ // int x = 10;
+ // int y = 15;
+ // {
+ // y = 10;
+ // System.out.println(x + " " + y);
+ // }
+ // {
+ // System.out.println(x + " " + y);
+ // }
+ }
+}
+```
+
+The provided Java code demonstrates different cases illustrating variable scope in Java. Let's go through each case:
+
+**Case 1:**
+
+```java
+public static void main(String args[]) {
+ int x = 10;
+ int y = 15;
+ {
+ System.out.println(x + " " + y);
+ }
+}
+
+```
+
+In this case, `x` and `y` are declared and initialized in the main method. Inside the block (denoted by curly braces {}), both `x` and `y` are accessible since they are in the same scope. **The output will be "10 15"**.
+
+**Case 2:**
+
+```java
+public static void main(String args[]) {
+ int x = 10;
+ {
+ int y = 15;
+ System.out.println(x + " " + y);
+ }
+ {
+ System.out.println(x + " " + y);
+ }
+}
+
+```
+
+In this case, `x` is declared and initialized in the main method. Inside the first block, `x` is accessible since it is in the same scope. However, `y` is declared within this block and is only accessible within this block. Attempting to access `y` in the second block will result in a compilation error because it is outside of its scope. **The output will be "10 15"**, **followed by a compilation error for the second System.out.println(x + " " + y);**.
+
+**Case 3:**
+
+```java
+public static void main(String args[]) {
+ int x = 10;
+ int y = 15;
+ {
+ y = 10;
+ System.out.println(x + " " + y);
+ }
+ {
+ System.out.println(x + " " + y);
+ }
+}
+
+```
+
+In this case, `x` and `y` are declared and initialized in the main method. Inside the first block, `x` and `y` are accessible since they are in the same scope. The value of `y` is modified to 10 inside the block. **The output will be "10 10"**. In the second block, `x` is accessible, but `y` is not redeclared, so the modified value from the previous block will be used. The output will be "10 10".
+
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher Functions.md b/Academy DSA Typed Notes/Java Refresher/Refresher Functions.md
new file mode 100644
index 0000000..a7d82cc
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher Functions.md
@@ -0,0 +1,359 @@
+# Refresher : Functions
+## Problem in Non-Functional Programming
+Let's understand the problems arises in Non-Functional programming by taking an example as:
+Suppose we have given three integers say a,b,c & we have to calculate the sum of digits of all these numbers seperately. So, the basic program to do that is as shown below.
+```java
+main(){
+ --------
+ --------
+ int sum1 = 0 , sum2 = 0 , sum3 = 0;
+ while(a > 0){
+ sum1 += a % 10;
+ a /= 10;
+ }
+ system.out.println(sum1);
+ while(b > 0){
+ sum2 += b % 10;
+ b /= 10;
+ }
+ system.out.println(sum2);
+ while(c > 0){
+ sum3 += c % 10;
+ c /= 10;
+ }
+ system.out.println(sum3);
+}
+```
+In the above code, we have to write the same piece of code thrice. So this is the major problem.
+The above code have many problems:
+* **Redundancy**.
+* **Readability**.
+* **Maintainability**.
+
+### How to Solve the Above Problems?
+We can solve the problems using black box technique as:
+
+
+Here, when we require to calculate the sum of digits then we will simply invoke this box and pass the integer in it, then it will return the sum as an output.
+
+When this box is taken together with input and output then this is known as the **function**. By using the function we can overcome the problems mentioned above.
+
+### Syntax of Function
+```java
+ansType function name(inputType input){
+ // Main logic.
+ return ans;
+}
+```
+This is how the typical function looks like.
+Let's create a function to sum 2 numbers.
+```java
+int 2sum(int a,int b){
+ int sum = a + b;
+ return sum;
+}
+```
+
+
+
+
+
+
+**Note:** In case, the return type is void then no need to return anything(return statement is optional).
+
+---
+### Question
+What will be the output?
+```java
+class Test {
+ public static int sum(int a, int b){
+ return a + b;
+ }
+
+ public static void main(String[] args){
+ int a = 15, b = 5;
+ System.out.println(sum(a, 10));
+ }
+}
+```
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] 20
+- [x] 25
+- [ ] 15
+- [ ] 0
+
+**Explanation**
+The a & b defined inside the sum function is different from that is defined in the main function. We have passed a & 10 as a argument. that's why the value of b that is defined inside the sum function is 10. Hence, the sum is 25.
+
+---
+### Question
+
+What will be the output?
+```java
+class Test {
+ public static int sum(int a, int b){
+ return a + b;
+ }
+
+ public static void main(String[] args){
+ int a = 15, b = 5;
+ sum(a,b);
+ }
+}
+```
+Choose the correct answer
+
+**Choices**
+
+- [ ] 20
+- [ ] Error
+- [ ] 15
+- [x] Nothing will be printed.
+
+**Explanation**
+
+There is not any printing statement like `system.out.print()`. Hence, nothing is printed.
+
+---
+### Question
+
+What will be the output?
+```java
+class Test {
+ public static int sum(int a, int b){
+ System.out.print(a + b);
+ }
+
+ public static void main(String[] args){
+ int a = 15, b = 5;
+ sum(a,b);
+ }
+}
+```
+
+Choose the correct answer
+
+**Choices**
+
+- [ ] 20
+- [x] Error
+- [ ] 15
+- [ ] Nothing will be printed.
+
+**Explanation**
+
+Error because the return type of sum function is int but it does not return anything.
+
+
+---
+### Question
+What will be the output?
+```java
+class Test {
+ public static int sum(int a, int b){
+ return a + b;
+ }
+
+ public static void main(String[] args){
+ int a = 15, b = 5;
+ System.out.println(sum(20, b));
+ }
+}
+```
+Choose the correct answer
+
+**Choices**
+
+- [ ] 20
+- [ ] Error
+- [x] 25
+- [ ] Nothing will be printed.
+
+---
+### Question
+
+What will be the output?
+```java
+class Test {
+ public static int sum(int a, int b){
+ return a + b;
+ }
+
+ public static void main(String[] args){
+ int a = 15, b = 5;
+ System.out.println(sum(6, 10));
+ }
+}
+```
+
+Choose the correct answer
+
+**Choices**
+- [ ] 20
+- [ ] Error
+- [x] 16
+
+---
+## Question 1
+
+Given an integer **N**, return whether the integer is even or not.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+12
+```
+##### Output 1
+```plaintext
+true
+```
+##### Input 2
+```plaintext
+5
+```
+##### Output 2
+```plaintext
+false
+```
+### PseudoCode
+```java
+public static boolean iseven(int n){
+ if(n % 2 == 0) return true;
+ else return false;
+}
+```
+
+---
+## Question 2
+
+Given an integer **N**, return whether its height is small, medium or large.
+* if it is less than 10, then its small.
+* if it is between 10 to 20, then its medium.
+* if it is greater than 20, then large.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+5
+```
+##### Output 1
+```plaintext
+small
+```
+##### Input 2
+```plaintext
+51
+```
+##### Output 2
+```plaintext
+large
+```
+### PseudoCode
+```java
+public static String height(int n){
+ if(n < 10) return "small";
+ else if(n < 20) return "medium";
+ else return "large".
+}
+```
+
+---
+## Question 3
+Given two doubles as argument, return the area of the rectangle.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+1.0
+2.0
+```
+##### Output 1
+```plaintext
+2.0
+```
+### PseudoCode
+```java
+public static double areaofrectangle(double a, double b){
+ double area = a * b;
+ return area;
+}
+```
+---
+## Question 4
+
+Given the radius(double) of the circle, return the area of the circle.
+
+#### TestCase
+##### Input 1
+```plaintext
+7.0
+```
+##### Output 1
+```plaintext
+154.0
+```
+### PseudoCode
+```java
+public static double areaofcircle(double radius){
+ double area = 3.14 * radius * radius;
+ return area;
+}
+```
+**Note:** Instead of writing the value of PI as 3.14, we can directly use the module Math.PI. To use that we have to import the maths library.
+
+---
+## Question 5
+
+Given an integer **N** as an input, print all the prime numbers between 1 to N.
+
+#### TestCase
+##### Input 1
+```plaintext
+10
+```
+##### Output 1
+```plaintext
+2 3 5 7
+```
+
+#### Explanation
+Prime number is the number which is not divisible by any oof the number except 1 and itself. So, to find the number of prime numbers between 1 to **N**, just count the number of itegers which divides it. if it is equal to 2 then it is prime number.
+
+#### PseudoCode
+
+```java
+public static void primenumbers(int n) {
+ for (int num = 1; num <= n; num++) {
+ int factors = 0;
+ for (int i = 1; i <= num; i++) {
+ if (num % i == 0) factors++;
+ }
+ if (factors == 2) system.out.print(num);
+ }
+}
+```
+
+We can further break it as:
+
+```java
+public static boolean isprime(int n) {
+ int factors = 0;
+ for (int i = 1; i <= num; i++) {
+ if (num % i == 0) factors++;
+ }
+ if (factors == 2) return true;
+ else return false;
+}
+public static void primenumbers(int n) {
+ for (int num = 1; num <= n; num++) {
+ if (isprime(num)) system.out.print(num);
+ }
+}
+```
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher HashMap & HashSet.md b/Academy DSA Typed Notes/Java Refresher/Refresher HashMap & HashSet.md
new file mode 100644
index 0000000..ce55dca
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher HashMap & HashSet.md
@@ -0,0 +1,518 @@
+# Refresher: HashMap & HashSet
+
+
+
+# HashSet
+HashSet is a collection of unique elements.
+
+## Example 1
+We have a bag, which has some numbers inside it.
+
+
+
+This bag has unique elements, which means every number appears once only.
+
+If we want to add 9 in a bag, then it will be not inserted as the bag already has 9.
+
+Some other examples which contain unique elements are:
+- Email-id
+- username
+- Fingerprints
+
+
+## Example 2
+Let us assume we have an array `arr = [1, 3, -2, 7, 1, 1, -2]`
+
+Now if we want to create a HashSet of it then it contains unique elements.
+
+`HS = [1, 7, -2, 3]`
+
+Here we can see that **hashset does not have any sequence of elements.**
+
+## Syntax
+
+```java
+HashSet hs = new HashSet();
+```
+
+Here Type can be any class
+
+## Basic Operations
+We can perform the following operations on HashSet.
+
+- **Add:** Used to add element in HashSet.
+- **Contains** Used to check whether HashSet contains a certain element or not.
+- Size
+- Remove
+- **Print:** We use each loop for printing the elements of HashSet
+
+---
+### Question
+For the given HashSet hs, what will be the size after the following operations?
+
+```
+HashSet hs = new HashSet();
+
+hs.add(3);
+hs.add(-2);
+hs.add(10);
+hs.add(3);
+hs.add(10);
+hs.add(0);
+```
+
+**Choices**
+
+- [ ] 2
+- [ ] 3
+- [ ] 5
+- [x] 4
+
+**Explanation**
+
+```plaintext
+The unique elements added to the HashSet are: 3, -2, 10, 0.
+So, the size of the HashSet is 4.
+```
+
+**Example**
+
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void main(String args[]){
+ HashSet hs = new HashSet();
+
+ //printing HashSet
+ System.out.println(hs);
+
+ // add
+ hs.add(3);
+ hs.add(-2);
+ hs.add(10);
+ hs.add(3);
+ hs.add(10);
+ hs.add(0);
+
+
+ System.out.println(hs);
+
+
+
+ // Contains
+ System.out.println(hs.contains(3));
+ System.out.println(hs.contains(-1));
+
+
+
+ // Size
+ System.out.println("Size is: " + hs.size());
+
+
+
+ // Remove
+ hs.remove(3);
+ System.out.println(hs);
+
+
+ // print
+ for(Integer i : hs){ // for each loop
+ System.out.println(i);
+ }
+ }
+}
+```
+
+**Output:**
+```plaintext
+[]
+[0, -2, 3, 10]
+true
+false
+Size is: 4
+[0, -2, 10]
+```
+
+
+---
+## ArrayList HashSet
+
+
+## ArrayList
+
+- Sequential order.
+- Duplicates allowed
+
+## HashSet
+- Sequence not maintained
+- Unique element present only.
+
+
+
+---
+## Problem Statement
+Given an integer array as input, add its elements to a HashSet and return the HashSet.
+
+
+## PseudoCode
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static HashSet convertToHashset(int[] arr){
+ HashSet ans = new HashSet();
+ for(int i = 0; i < arr.length; i++){
+ ans.add(arr[i]);
+ }
+ return ans;
+ }
+ public static void main(String args[]){
+ int arr[] = {1, 4, 3, -2, 1, 1, 4, 5, 3};
+ System.out.println(convertToHashset(arr));
+ }
+}
+```
+
+**Output:**
+```plaintext
+[1, -2, 3, 4, 5]
+```
+
+
+---
+## Problem Statement
+Given 2 HashSet as input, print their common elements.
+
+
+## Example
+**Input:**
+HS1: {0, -2, 4, 10}
+HS2: {1, -2, 3, 4, 5}
+
+
+**Output:** -2 3
+
+## Understanding the problem
+We have to print the elements that are present in both the HashSet.
+
+
+## PseudoCode
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void intersect(HashSet hs1, HashSet hs2){
+ for(Integer i : hs1){
+ if(hs2.contains(i)){
+ System.out.print(i + " ");
+ }
+ }
+ }
+ public static HashSet convertToHashset(int[] arr){
+ HashSet ans = new HashSet();
+ for(int i = 0; i < arr.length; i++){
+ ans.add(arr[i]);
+ }
+ return ans;
+ }
+ public static void main(String args[]){
+ int arr[] = {1, 4, 3, -2, 1, 1, 4, 5, 3};
+ HashSet hs1 = convertToHashset(arr);
+ System.out.println(hs1);
+
+ int arr2[] = {0, -2, 3, 10};
+ HashSet hs2 = convertToHashset(arr2);
+ System.out.println(hs2);
+
+ intersect(hs1, hs2);
+ }
+}
+```
+
+**Output:**
+```plaintext
+[1, -2, 3, 4, 5]
+[0, -2, 3, 10]
+-2 3
+````
+
+---
+### Question
+What operation is used to remove an element from a HashSet?
+
+**Choices**
+
+- [ ] Add
+- [ ] Size
+- [x] Remove
+- [ ] Contain
+
+**Explanation**
+
+```plaintext
+The `Remove` operation is used to remove an element from a HashSet.
+```
+
+---
+## HashMap
+HashMap is a data structure which contains key-value pairs.
+
+## Example
+Let us suppose we have states and its population.
+
+| States | Population |
+|:-------:|:----------:|
+| Punjab | 15 |
+| Haryana | 18 |
+| UP | 20 |
+| Delhi | 18 |
+
+Now if we have the above data, and our question is to tell the population of UP, then we can simply tell the value next to UP(20).
+Here we can say UP->20 is a pair, where UP is a key, corresponding to which some values are stored, and by this key, we access the data.
+
+
+Here states are key and population are values.
+
+| States(key) | Population(value) |
+|:-----------:|:-----------------:|
+| Punjab | 15 |
+| Haryana | 18 |
+| UP | 20 |
+| Delhi | 18 |
+
+Some other examples are:
+- User id -> password
+- Word -> Meaning (dictionary)
+
+
+## Features of HashMap
+
+- Duplicate values are allowed
+
+
+
+
+
+- Duplicate keys are not allowed.
+
+
+
+
+- No order of data, key-value pairs are in random order.
+
+
+## Syntax
+```java
+HashMap hm = new HashMap();
+```
+
+## Basic Operations
+
+We can perform the following operations on HashMap.
+
+- Add
+- Contains
+- Get
+- Update
+- Size
+- Remove
+- Print
+
+### Example
+
+
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static void main(String args[]){
+
+ HashMap hm = new HashMap();
+
+
+
+ // add
+ hm.put("Delhi", 18);
+ hm.put("Punjab", 20);
+ hm.put("Haryana", 18);
+ hm.put("Goa", 5);
+
+
+ System.out.println(hm);
+
+
+
+ // Contains
+ System.out.println(hm.containsKey("Gujarat"));
+ System.out.println(hm.containsKey("Goa"));
+
+ // Get
+ System.out.println(hm.get("Gujarat"));
+ System.out.println(hm.get("Goa"));
+
+
+ // Update
+ hm.put("Goa", 6);
+ System.out.println(hm);
+
+ // Size
+ System.out.println("Size is: " + hm.size());
+
+
+
+ // Remove
+ hm.remove("Goa");
+ System.out.println(hm);
+
+
+ // print
+ // 1. get all keys
+ // hm.keySet()-> returns a set of keys of HashMap
+ // 2. Use keys to iterate over the map
+ for(String state : hm.keySet()){
+ System.out.println(state + " -> " + hm.get(state));
+ }
+ }
+}
+```
+
+
+**Output:**
+```plaintext
+{Delhi = 18, Haryana = 18, Goa = 5, Punjab = 20}
+false
+true
+null
+5
+{Delhi = 18, Haryana = 18, Goa = 6, Punjab = 20}
+Size is: 4
+{Delhi = 18, Haryana = 18, Punjab = 20}
+Delhi -> 18
+Haryana -> 18
+Punjab -> 20
+```
+
+---
+### Question
+In a HashMap, what is the purpose of the get operation?
+
+**Choices**
+
+- [ ] Add a key-value pair
+- [x] Retrieve the value associated with a key
+- [ ] Check if a key is present
+- [ ] Remove a key-value pair
+
+**Explanation**
+
+```plaintext
+The `get` operation in HashMap is used to retrieve the value associated with a given key.
+```
+
+---
+## Problem Statement
+Given an integer array as input, return the corresponding frequency map.
+
+
+## Example
+**Input:**
+arr = [1, 4, 3, -2, 1, 1, 4, 5, 3]
+
+
+**Output:**
+```plaintext
+hm = {
+ 1: 3,
+ 4: 2,
+ 3: 2,
+ -2: 1,
+ 5: 1
+}
+```
+
+## Solution
+In this, we iterate over every element of an array, for every element we have two possibilities.
+1. Current element is not in the hashmap(`hm.containsKey(arr[i]) == false`).
+then add the current element into HashMap with frequency 1.
+2. The current element is already present in the HashMap as a key and has some value.
+then simply increase the previously stored frequency of the current element by 1.
+
+
+## PseudoCode
+```java
+import java.util.*;
+import java.lang.*;
+class Main{
+ public static HashMap freqMap(int arr[]){
+ HashMap hm = new HashMap();
+ for(int i = 0; i < arr.length; i++){
+ // case 1 - arr[i] not present in hashmap
+ if(hm.containsKey(arr[i]) == false){
+ hm.put(arr[i],1);
+ }
+ // case - arr[i] already present in hashmap
+ // before current element, hm -> {2: 3}
+ // current -> 2
+ // hm -> {2: 3}
+ else{
+ int beforeValue = hm.get(arr[i]);
+ int newValue = beforeValue + 1;
+ hm.put(arr[i], newValue);
+ }
+ }
+ return hm;
+ }
+ public static void main(String args[]){
+ int arr[] = {1, 4, 3, -2, 1, 1, 4, 5, 3};
+ System.out.println(freqMap(arr));
+ }
+}
+```
+
+**Output:**
+```plaintext
+{1 = 3, -2 = 1, 3 = 2, 4 = 2, 5 = 1}
+````
+
+
+## DryRun
+**Input:**
+arr[] = {1, 4, 3, -2, 1, 1, 4, 5, 3}
+
+**Solution:**
+1. Initially our hashmap is empty, `hm = {}`,
+2. Now we start iterating array elements, first element is 1, it is not in HashMap so if the condition becomes true, then we will simply put this element in the map with frequency 1. `hm = {1: 1}`.
+3. Next element is 4, it is also not in HashMap so if the condition becomes true, then we will simply put this element in the map with frequency 1. `hm = {1: 1, 4: 1}`.
+4. Next element is 3, it is also not in HashMap so if the condition becomes true, then we will simply put this element in the map with frequency 1. `hm = {1: 1, 4: 1, 3: 1}`.
+5. Next element is -2, it is also not in HashMap so if the condition becomes true, then we will simply put this element in the map with frequency 1. `hm = {1: 1, 4: 1, 3: 1, -2: 1}`.
+6. The next element is 1, it is available in HashMap, so if the condition becomes false, we will go to the else part.
+```java
+beforeValue = hm.get(1) = 1
+newValue = beforeValue + 1 = 1 + 1 = 2
+hm.put(1, 2)
+```
+then hashmap becomes, `hm = {1: 2, 4: 1, 3: 1, -2: 1}`.
+7. The next element is again 1, it is available in HashMap, so if the condition becomes false, we will go to the else part.
+```java
+beforeValue = hm.get(1) = 2
+newValue = beforeValue + 1 = 2 + 1 = 3
+hm.put(1, 3)
+```
+then hashmap becomes, `hm = {1: 3, 4: 1, 3: 1, -2: 1}`.
+8. The next element is 4, it is available in HashMap, so if the condition becomes false, we will go to the else part.
+```java
+beforeValue = hm.get(4) = 1
+newValue = beforeValue + 1 = 1 + 1 = 2
+hm.put(4, 2)
+```
+then hashmap becomes, `hm = {1: 3, 4: 2, 3: 1, -2: 1}`.
+9. Next element is 5, it is also not in HashMap so if the condition becomes true, then we will simply put this element in the map with frequency 1. `hm = {1: 3, 4: 2, 3: 1, -2: 1, 5: 1}`.
+10. The next element is 3, it is available in HashMap, so if the condition becomes false, we will go to the else part.
+```java
+beforeValue = hm.get(3) = 1
+newValue = beforeValue + 1 = 1 + 1 = 2
+hm.put(3, 2)
+```
+then hashmap becomes, `hm = {1: 3, 4: 2, 3: 2, -2: 1, 5: 1}`.
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher Introduction to Java If-Else.md b/Academy DSA Typed Notes/Java Refresher/Refresher Introduction to Java If-Else.md
new file mode 100644
index 0000000..c100657
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher Introduction to Java If-Else.md
@@ -0,0 +1,683 @@
+ # Refresher : Introduction to Java : If-Else
+
+## If-Else
+
+#### Example
+Let's start with real world example of ordering coffee from a cafe :-
+
+* The customer might ask the receptionist ***If* you have coffee then provide coffee.**
+
+* Or ***If* you have coffee then provide coffee, *else* provide tea**
+
+
+* In programming we have to tackle real world situations.
+* **How can we tackle the situation described above in the example using programming ?**
+* If we pay attention to questions asked in the example we find the following keywords ***If*** & ***Else***.
+* We can code the above situations using if else conditions.
+
+
+#### If-Else Syntax
+```cpp
+if(is coffee available ? ){
+ // serve coffee
+}
+else{
+ // serve tea
+}
+```
+
+* **Is coffee available ?** is the **Condition**.
+* **The condition is statement which can have only true/false as answers** or we say it's of **boolean** type
+
+
+
+---
+## Question 1
+
+
+### Question
+Given an integer age as input, print whether the person is eligible to vote or not ?
+> A person is eleigible if the person's age >= 18
+
+#### Testcase 1
+
+```plaintext
+Input :
+20
+```
+#### Solution 1
+
+`Output : Eligible`
+#### Testcase 2
+
+```plaintext
+Input :
+14
+```
+#### Solution 2
+`Output : Not Eligible`
+
+#### Approach
+* Using conditional statements we check:
+ * If age is >= 18 print Eligible.
+ * Else print Not Eligible
+#### Pseudeocode
+```cpp
+public static void main() {
+
+ if (age >= 18) {
+ System.out.print("Eligible");
+ } else {
+ System.out.print("Not Eligible");
+ }
+}
+```
+
+---
+## Question 2
+
+### Question
+Given two integers A and B as input, print the larger
+> A will not be equal to B
+#### Testcase 1
+
+```plaintext
+Input :
+A = 4, B = 6
+```
+#### Solution 1
+`Output : 6 is bigger`
+
+#### Testcase 2
+
+```plaintext
+Input :
+A = 9, B = 6
+```
+#### Solution 2
+`Output : 9 is bigger`
+
+#### Approach
+
+* Using conditional statements we check:
+ * If A > B print **A is bigger**.
+ * Else print **B is bigger**.
+
+#### Pseudeocode
+```java
+public static void main() {
+
+ scn = new Scanner(System.in);
+
+ int A = scn.nextInt();
+ int B = scn.nextInt();
+
+ if (A > B) {
+ System.out.print(A + "is bigger");
+ } else {
+ System.out.print(B + "is bigger");
+ }
+}
+```
+---
+## Question 2 part 2
+
+
+### Question
+Given two integers A and B as input, print the large
+
+#### Testcase 1
+
+```plaintext
+Input :
+A = 4, B = 6
+```
+#### Solution 1
+`Output : 6 is bigger`
+#### Testcase 2
+
+```plaintext
+Input :
+A = 9, B = 6
+```
+#### Solution 2
+`Output : 9 is bigger`
+
+#### Testcase 2
+
+```plaintext
+Input :
+A = 6, B = 6
+```
+#### Solution 2
+`Output : Both are equal`
+
+#### Approach
+* Using conditional statements we check:
+ * If A > B print **A is bigger**.
+ * Else if A < B print **B is bigger**.
+ * Else print **Both are equal**.
+
+#### Pseudeocode
+```java
+public static void main() {
+
+ scn = new Scanner(System.in);
+
+ int A = scn.nextInt();
+ int B = scn.nextInt();
+
+ if (A > B) {
+ System.out.print(A + "is bigger");
+ } else if (B > A) {
+ System.out.print(B + "is bigger");
+ } else {
+ System.out.print("Both are equal");
+ }
+}
+
+```
+
+---
+## Question 3
+
+
+### Question
+Given temperature of patient in farenheit as input,
+print whether the temperature is low, normal, high
+>normal from 98.2 till 98.8
+
+#### Testcase 1
+
+```plaintext
+Input :
+98.1
+```
+#### Solution 1
+`Output : Low`
+#### Testcase 2
+
+```plaintext
+Input :
+98.5
+```
+#### Solution 2
+`Output : normal`
+
+#### Testcase 3
+
+```plaintext
+Input :
+99.3
+```
+#### Solution 3
+`Output : high`
+
+---
+
+
+### Question
+Which data type should be used to store temperature of a patient ?
+
+
+**Choices**
+
+- [x] Double
+- [ ] Int
+- [ ] String
+- [ ] long
+
+**Solution**
+
+```plaintext
+Double is used to store the numbers with decimals.
+```
+
+#### Approach
+* Using conditional statements we check:
+ * If temperature is < 98.2 print low.
+ * Else if temperature > 98.5 print high**.
+ * Else print normal
+
+#### Pseudeocode
+```java
+public static void main() {
+ scn = new Scanner(System.in);
+
+ double temperature = scn.nextDouble();
+
+ if (temperature < 98.2) {
+ System.out.print("low");
+ } else if (temperature > 98.8) {
+ System.out.print("high");
+ } else {
+ System.out.print("normal");
+ }
+}
+```
+
+---
+## Operators
+
+
+### Division
+* Division is denoted by **/** operator.
+* Provided below is the output datatype based on dividend and divisor datatype.
+
+ * int / int ---> int
+ * float / int ---> float
+ * int / float ---> float
+ * float / float ---> float
+ * long / int ---> long
+ * double / float ---> double
+ * int / long are replacable
+ * float / double are replacable
+
+* To convert a number to float put a f in the ending of it.
+* To convert a number to double we can write it with .0 in the end.
+
+#### Example
+```cpp
+System.out.println(9 / 3) ; // int / int ---> int output would be 3
+System.out.println(11 / 3); // int / int ---> int output would be 3
+System.out.println(11f / 3) ; // float / int ---> float output would be 3.6666
+```
+### Multiplication
+
+* Multiplication is denoted by * operator.
+* Provided below is the output datatype based on multiplicand and multiplier datatype.
+ * int * int ---> int
+ * int * long ---> long
+ * long * int ---> long
+ * long * long --->long
+ * int / float are replacable
+ * long / double are replacable
+
+#### Example 1
+```java
+int x = 100000;
+int y = 100000;
+int z = x * y
+System.out.println(z); // prints garbage value
+```
+* The above code gives garbage value as output but **why ?**
+* We can see that when we multiply x and y i.e 100000 * 100000 then output would be 1010.
+* Since the range of integer datatype is roughly 109 we would get garbage value due to overflow as we store it in z (int).
+
+#### Example 2
+```java
+int x = 100000;
+int y = 100000;
+long z = x * y
+System.out.println(z); // prints garbage value
+```
+* The above code gives garbage value as output but **why ?** **even though we have changed the datatype of z from int ---> long.**
+* We have changed the datatype of z but the according to rules above :-
+ * int * int ---> int
+* Therefore we need to explicitly change datatype of the multiplicand or the multiplier to long so that :-
+ * long * int ---> long
+* Therefore :-
+```java
+int x = 100000;
+int y = 100000;
+long z = (long)x * y;
+System.out.println(z); // prints 10000000000
+```
+
+---
+
+### Question
+What will be the output according to Java :
+```java
+int a = 100000;
+int b = 400000;
+long c = (long)(a * b);
+System.out.println(c);
+```
+
+**Choices**
+
+- [x] Some random number
+- [ ] 40000000000
+- [ ] Compilation error
+- [ ] No Output
+
+**Solution**
+
+* First we are doing a * b i.e int * int therefore the output will be int.
+* Overflow would have already occured before typecasting to long.
+* Hence the random value is printed.
+
+---
+### Operators Continued
+
+
+### Modulo
+* Modulo is denoted by **%** operator.
+* Gives us the remainder when a is divided by b i.e. a % b = remainder when a is divided by b.
+
+#### Examples
+* 7 % 3 ---> 1
+* 8 % 5 ---> 3
+* 10 % 1 ---> 0
+* 5 % 12 ---> ?
+ * Answer is 5 by **why ?**.
+ * Because 5 % 12 = 12 * 0 + 5 where 5 is dividend, 12 is divisor , 0 is quotient & 5 is remainder.
+
+---
+
+
+### Question
+What is the result?
+System.out.print(17 % 4);
+
+**Choices**
+
+- [x] 1
+- [ ] 4
+- [ ] 16
+- [ ] 5
+
+**Solution**
+
+```plaintext
+dividend = divisor* quotient + remainder
+=> 17 = 4 * 4 + 1
+```
+
+---
+
+### Question
+What will be the result of a % b, when b perfectly divides a with no remainder ?
+
+**Choices**
+
+- [x] 0
+- [ ] b -1
+- [ ] b
+- [ ] a
+
+**Solution**
+```plaintext
+dividend = divisor * quotient + remainder
+if dividend is divided perfectly by divisor then the remainder is 0
+```
+
+---
+## Question 4
+
+
+### Question
+Given an integer as input, print whether it is even or Odd
+
+#### Testcase 1
+
+```plaintext
+Input :
+3
+```
+
+#### Solution 1
+`Output : odd`
+
+#### Testcase 2
+
+```plaintext
+Input :
+6
+```
+#### Solution 2
+`Output : even`
+
+---
+
+
+### Question
+
+If a % 2 == 0, what can we say about a ?
+
+**Choices**
+
+- [x] even
+- [ ] odd
+- [ ] prime
+- [ ] remainder
+
+---
+### Approach
+* Using conditional statements we check:
+ * If A % 2 == 0 print **even**.
+ * Else print **odd**.
+
+#### Pseudeocode
+```cpp
+public static void main() {
+ scn = new Scanner(System.in);
+
+ int A = scn.nextInt();
+ int B = scn.nextInt();
+
+ if (A % 2 == 0) {
+ System.out.print("even");
+ } else {
+ System.out.print("odd");
+ }
+}
+```
+
+
+---
+## Question 5
+
+
+### Question
+Q5 : Given an integer as input, print its last digit
+
+#### Testcase 1
+
+```plaintext
+Input :
+73
+```
+#### Solution 1
+`Output : 3`
+#### Testcase 2
+
+```plaintext
+Input :
+651
+```
+#### Solution 2
+`Output : 1`
+
+#### Approach
+
+* Print A % 10
+
+#### Pseudeocode
+```cpp
+scn = new Scanner(System.in);
+
+int A = scn.nextInt();
+
+System.out.print(A % 10);
+```
+
+
+---
+### Operators Continued
+
+
+### Relational Operators
+* **A > B** ---> Checks weather A is greater than B.
+* **A < B** ---> Checks weather A is less than B.
+* **A >= B** ---> Checks weather A is greater than or equalt to B.
+* **A <= B** ---> Checks weather A is less than or equal to B.
+* **A == B** ---> Checks weather A is equals B.
+* **A != B** ---> Checks weather A is not equal to B.
+
+### Logical Operators
+* AND operator is denoted by **&&**
+* Truth table is provided below.
+
+| A | B | A && B |
+|:---:|:---:|:------:|
+| T | F | F |
+| F | T | F |
+| F | F | F |
+| T | T | T |
+
+* OR operator is denoted by **||**
+* Truth table is provided below.
+
+| A | B | A && B |
+|:---:|:---:|:------:|
+| T | F | T |
+| F | T | T |
+| F | F | F |
+| T | T | T |
+
+
+
+---
+## Question 6
+
+
+### Question
+
+Q6 : Given units of electricity consumed as an integer input A, print the bill amount. Provided below is the range of electricity consumed and rate at which it is charged:-
+[1-50] ---> ₹1
+[51-100] ---> ₹2
+[101 and beyond] ---> ₹4
+
+#### Testcase 1
+
+```plaintext
+Input :
+20
+```
+#### Solution 1
+`Output : 20 * 1 = 20`
+
+#### Testcase 2
+
+```plaintext
+Input :
+80
+```
+#### Solution 2
+`Output : 50 * 1 + 30 * 2 = 110`
+
+#### Testcase 3
+
+```plaintext
+Input :
+120
+```
+#### Solution 3
+`Output : 50 * 1 + 50 * 2 + 20 * 4= 230`
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+#### Pseudeocode
+```java
+public static void main() {
+
+ scn = new Scanner(System.in);
+ int A = scn.nextInt();
+
+ if (A >= 1 && A <= 50) {
+ System.out.print(A * 1);
+ } else if (A >= 51 && A <= 100) {
+ System.out.print(50 + (A - 50) * 2);
+ } else {
+ System.out.print(50 + (50 * 2) + ((A - 100) * 4));
+ }
+}
+```
+
+---
+### Question 7
+
+### Question
+Q7 : Given an integer A as input
+* If it is a multiple of 3, print Fizz
+* If it is a multiple of 5, print Buzz
+* If it is a multiple of 3 and 5, print Fizz-Buzz
+
+#### Testcase 1
+
+```plaintext
+Input :
+5
+```
+
+#### Solution 1
+`Output : Buzz`
+
+#### Testcase 2
+
+```plaintext
+Input :
+3
+```
+
+#### Solution 2
+`Output : Fizz`
+
+#### Testcase 3
+
+```plaintext
+Input :
+30
+```
+
+#### Solution 3
+`Output : Fizz-Buzz`
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+#### Approach 1
+```java
+public static void main() {
+
+ scn = new Scanner(System.in);
+ int A = scn.nextInt();
+
+ if (A % 3 == 0) {
+ System.out.print("Fizz");
+ } else if (A % 5 == 0) {
+ System.out.print("Buzz");
+ } else if (A % 3 == 0 && A % 5 == 0) {
+ System.out.print("Fizz-Buzz");
+ }
+}
+```
+* When we test the above approach on A = 30, we get output as "Fizz"
+* But correct output would be "Fizz-Buzz", so **why the wrong answer ?**
+* Since if-else work in a chained manner the condition A % 3 == 0 is checked first.
+* Therefore "Fizz" is printed
+* Correct approach would be to check condition ( A % 3 == 0 && A % 5 == 0 ) first.
+
+#### Pseudeocode
+```java
+public static void main() {
+
+ scn = new Scanner(System.in);
+ int A = scn.nextInt();
+
+ if (A % 3 == 0 && A % 5 == 0) {
+ System.out.print("Fizz-Buzz");
+ } else if (A % 5 == 0) {
+ System.out.print("Buzz");
+ } else if (A % 3 == 0) {
+ System.out.print("Fizz");
+ }
+}
+```
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher Introduction to Java Input and Output + Data Types + Operators.md b/Academy DSA Typed Notes/Java Refresher/Refresher Introduction to Java Input and Output + Data Types + Operators.md
new file mode 100644
index 0000000..d847ff4
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher Introduction to Java Input and Output + Data Types + Operators.md
@@ -0,0 +1,476 @@
+# Introduction to Problem Solving
+
+---
+## Agenda
+
+1. Output in Java
+2. Data Types
+3. Typecasting
+4. Input
+5. Quizzes
+6. Dashboard Walkthrough
+
+
+---
+## Output in Java
+Let's start with the famous example - **Hello World**
+
+
+### Code to Print string/sentence/text
+```cpp
+public static void main(){
+
+ System.out.print("Hello World!");
+
+}
+```
+
+### Code to **print number**
+```cpp
+public static void main(){
+
+ System.out.print(1);
+
+}
+
+```
+
+### Observation
+* Whenever we print a string, we put double quotes **" "** around it.
+* Double quotes are not required for printing numbers.
+
+---
+### Question
+System.out.print("Hey There");
+
+**Choices**
+- [x] Hey There
+- [ ] "Hey There"
+- [ ] Error
+- [ ] "Hey There
+
+**Explanation**
+String between **""** will get printed. Therefore, solution is **Hey There**
+
+---
+### Question
+system.out.print(10);
+
+**Choices**
+- [x] Error
+- [ ] 2
+- [ ] 10
+- [ ] "10"
+
+
+**Solution**
+There is syntax error in above code.
+Instead of **"system"** it should be **"System"**.
+Error thrown is - "error: package system does not exist"
+
+
+---
+### Question
+
+Predict the output:
+System.out.print("5 * 10");
+
+**Choices**
+
+- [x] 5 * 10
+- [ ] "5 * 10"
+- [ ] 50
+- [ ] Error
+
+
+**Solution**
+
+Prints the sentence / string / charactes between **""**, so instead of doing calculation & printing 50, we get :-
+**5 * 10**
+
+---
+### Output in Java Continued
+
+#### Code to Print Answers to Basic Arithimetic Operations
+
+```cpp
+public static void main(){
+
+ System.out.print(5 * 10); // gives 50 as output
+ System.out.print(10 / 5); // gives 2 as output
+ System.out.print(10 + 5); // gives 15 as output
+ System.out.print(10 - 5); // gives 5 as output
+
+}
+```
+* **We use println to print in next line**
+
+```cpp
+public static void main(){
+ System.out.println("My name is [instructor]");
+ System.out.print("I am from [Hometown]");
+}
+```
+
+---
+### Question
+
+```java
+System.out.println("This question");
+System.out.println("is easy!");
+```
+What's output of the above program ?
+
+
+**Choices**
+- [ ] This question is easy!
+- [ ] This questionis easy!
+- [x] This question
+ is easy!
+- [ ] This question's easy!
+
+
+**Solution**
+
+In first statement println is written hence "This question" gets printed and control goes to new line, then in next line, again println is there, so "is easy!" gets printed and control goes to next line.
+
+
+---
+### Question
+```java
+System.out.println("Red");
+System.out.print("Blue ");
+System.out.println("Green");
+System.out.print("Yellow");
+```
+What's output of the above programme ?
+
+**Choices**
+- [ ] Red
+ Blue Green Yellow
+- [x] Red
+ Blue Green
+ Yellow
+- [ ] Red
+ BlueGreen
+ Yellow
+- [ ] Red Blue Green Yellow
+
+
+**Solution**
+
+First line has println, so after "Red" gets printed, control goes to new line.
+Second statement has print, so after "Blue " gets printed, controls stays in the same line
+Third line has println, so after "Green" gets printed, control goes to new line.
+Fourth statement has print, so after "Yellow" gets printed, controls stays in the same line
+
+---
+### Output in Java Continued
+
+* We can do single line comments by ---> **//**
+```cpp
+// single line comment
+```
+* We can do multi-line comments by ---> /* */
+```cpp
+/*
+ this
+ is a
+ multiline
+ comment
+*/
+```
+* Shortcut to do multi-line comments is to select the part to be commented and press ctrl + /
+
+* We can concatenate two strings like:-
+```cpp
+System.out.println("Ram " + "Shayam"); // output: ram shayam and the control will go to the next line
+System.out.println("My age is " + 25 ); // output: My age is 25 and the control will go to the next line
+```
+
+---
+### Question
+
+Predict the output:
+System.out.print( 7 + 1 + "156");
+
+**Choices**
+- [ ] 71156
+- [x] 8156
+- [ ] 1568
+- [ ] 15617
+
+---
+### Question
+
+Predict the output:
+System.out.print("156" + 7 + 1);
+
+**Choices**
+- [ ] 1568
+- [ ] 15678
+- [x] 15671
+- [ ] 1568
+
+**Solution**
+
+Calculation shall happen from left to right.
+For first +, one operand is number and another is string, so it will concatenate them, i.e 1567.
+Then for second +, both operands are string, therefore concatenation will happen.
+Hence, **answer is 15671**.
+
+---
+## Data types in java
+
+### Data types
+
+1. **Primitive Data Types**
+ These are predefined in the Java programming language.
+**For example:** byte, short, int, long, double, float, boolean, char
+
+2. **Non-Primitive Data Types**
+
+ These are not predefined but defined by the programmer according to the need for a particular task.
+**For example:** String, Arrays, class, etc.
+
+
+
+
+
+**Primitive data types** are divided into two different types of values.
+
+1. Numeric Data Types
+2. Non-Numeric Data Types
+
+
+#### Numeric Data Types
+Numeric data types are used to store numeric values such as whole numbers and fractional numbers. They are divided into two parts, **integer** and **floating**.
+
+**1. Integer**
+
+**Byte, short, long, and int** these data types are used to store **whole numbers**
+
+
+A. **Byte** Datatype:
+
+It is commonly used when we want to store very small numbers of very limited size. Their data value is in the range of -128 to 127.
+```cpp
+byte a = 123;
+System.out.print(a); //Printing 123
+```
+
+B. **Short** Data Type
+
+The short data type can have data values- in the range of -32,768 to 32767.
+
+```cpp
+short a = 123;
+System.out.println(a); //Printing 123
+```
+
+C. **Int** Data Type
+
+The int data type is commonly used when we want to save memory in large arrays. The range is from -2,147,483,648 (-2^31) to 2,147,483,647 (2^31-1).
+
+```cpp
+int a = 123;
+System.out.println(a); //Printing the 123
+```
+
+D. **Long** Data Type
+
+The long data type is used when the int data type cannot handle a wider range than the int data type range. Data values is in the range of -9,223,372,036,854,775,808(-2^61) to 9,223,372,036,854,775,807(2^61 - 1).
+
+```cpp
+long a = 123123123;
+System.out.println(a); //Printing the value of a
+```
+
+**2. Floating Values Data Types**
+There are two types of Floating values data types in java that are used to store fractional number values.
+
+E. **Float** Data Type:
+This data type is used to store numbers that have decimals up to 6 and 7 points.
+```cpp
+float a = 1231.231;
+System.out.println(a); //Printing the value of a
+```
+
+F. **Double** Data Type:
+This data type is used to store numbers that have decimals up to 15 decimals
+```cpp
+double a = 12312.23123;
+System.out.print(a); //Printing the value of a
+```
+
+We generally use Integer and Long Data Types.
+Remember their actual range is very tricky. Therefore, we can remember by stating in power of 10.
+
+### Close Approximations:
+**Int** - { -10^9 to 10^9 }
+**Long** - { -10^18 to 10^18 }
+
+#### Non Numeric Data Types
+
+**String**
+Strings can be created by giving sequence of characters surrounded by double quotes to a variable.
+
+Example:
+
+String S = “This is a String”
+
+**Note:** We will study non primitive data types later.
+
+---
+## Typecasting in java
+
+
+### Typecasting
+* Typecasting is converting one datatype to another.
+* We can understand the concept of typecasting by following analogy.
+* Let's have two tanks
+ * one large, with more capacity(say 100ml)
+ * one small (say 50ml)
+* The large tanks corresponds to long datatype and small one corresponds to int datatype.
+* Let's see the cases
+* **Case 1:-** If water from smaller tank is poured to larger tank (int to long typecasting).
+ * In this case the larger tank hold all the water or we can say int can be typecasted to long.
+ 
+
+* **Case 2:-** If larger tank has water <= 50 ml and water from larger tank is poured to smaller tank.
+ * Since the water in larger tank is equal to smaller tanks capacity the operation can be done.
+ * We can say that long can be typecasted to int, if the data is within constraints of int datatype value range.
+ 
+
+* **Case 3:-** If larger tank has water > 50 ml and water from larger tank is poured to smaller tank.
+ * In this case, water will OVERFLOW.
+ 
+ * When long is typecasted to int for data not within constraints of int datatype, the result would be **garbage value**.
+
+#### Using variables
+```cpp
+String name = "arnav"
+System.out.print("My name is " + name)
+```
+
+* We can declare variables as follows:-
+```cpp
+int i = 5;
+long p = 1000000000l;
+float f = 3.14f;
+double d = 1.141516171819;
+```
+
+* By default integers are considered int
+* By default decimal values are considered double
+* Convention of putting l ,f before long and float is only in coding area, not in input
+
+#### Typecasting example 1
+```cpp
+// small --> large
+int i = 5,
+long I = i;
+System.out.println(I); // will give 5 as output
+```
+
+#### Typecasting example 2
+```cpp
+// large —-> small
+long l = 100000000000l
+int i = l
+System.out.print(i);
+```
+* Above conversion will give an error:-Datatypes incompatible possible lossy conversion.
+* This type of typecasting is **implicit typecasting**.
+
+#### Typecasting example 3
+```cpp
+// large —> small
+long l = 1000l;
+int i = l;
+System.out.print(i);
+```
+* For safety, above conversion will give an error:- Datatypes incompatible possible lossy conversion.
+* We can force the conversion by using **explicit typecasting**
+```cpp
+long l = 1000l;
+int i = (int)l; // forcing to convert; explicit typecasting
+System.out.print(i);// 1000 as output
+```
+* If we force the same typecasting with data out of int value range
+* In above case we would get garbage value.
+```cpp
+long l = 10000000000l;
+int i = (int)l;
+// forcing to convert
+// explicit typecasting
+System.out.print(i);// garbage value as output
+```
+
+---
+### Input in java
+
+
+* Scanner class is used to take inputs in java.
+* Following are the methods to take number inputs in java:-
+```cpp
+scn = new Scanner(System.in);
+int i = scn.nextInt();
+long t = scn.nextLong();
+float f = scn.nextFloat( ) ;
+double d = scn.nextDouble();
+
+```
+* Following are methods to take string input in java.
+```cpp
+//scn. next ( ) —> Reads only 1 word from input
+String s = scn.next();
+System. out. print(s);
+
+//scn.nextLine() —> Reads entire line from input
+String s1 = scn.nextLine();
+System.out.print(s1);
+```
+
+---
+## Question 1
+
+### Question
+Take 2 names X and Y as input and print X loves Y.
+### Testcase
+
+```java
+X = Ram
+Y = Shyam
+```
+### Solution
+
+`Output : Ram loves Shyam`
+
+#### Code
+```java
+String x = scn.next();
+String y = scn.next();
+System.out.print(x + " loves " + y);
+```
+
+---
+## Question 2
+
+
+### Question
+Take name X and age Y as input and print X age is Y.
+### Testcase
+
+```cpp
+X = Aarnav
+Y = 25
+```
+### Solution
+`Output : Aarnav age is 25`
+#### Code
+```java
+String x = scn.next();
+String y = scn.nextInt();
+System.out.print(x + " age is " + y);
+```
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher Patterns.md b/Academy DSA Typed Notes/Java Refresher/Refresher Patterns.md
new file mode 100644
index 0000000..1599f2b
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher Patterns.md
@@ -0,0 +1,493 @@
+# Refresher : Patterns
+
+## Question 1
+Given **N** as input, print * **N** times.
+
+#### TestCase
+
+##### Input
+```plaintext
+5
+```
+##### Output
+```plaintext
+* * * * *
+```
+#### PseudoCode
+```java
+function pattern(int N) {
+ for (int i = 1; i <= N; i++) {
+ system.out.print(' * ');
+ }
+}
+```
+
+---
+## Question 2
+
+Given **N** as input. Print a square of size **N * N** containing * in each cell.
+
+#### TestCase
+
+##### Input
+```plaintext
+5
+```
+##### Output
+```plaintext
+* * * * *
+* * * * *
+* * * * *
+* * * * *
+* * * * *
+```
+#### PseudoCode
+```java
+function pattern(int N){
+ for(int i = 1 ; i <= N ; i ++ ){
+ for(int j = 1 ; j <= N ; j ++ ){
+ system.out.print(' * ');
+ }
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 3
+
+Given **N**,**M** as input, print a rectangle of size **N * M** containing * in each cell.
+
+#### TestCase
+
+##### Input
+```plaintext
+N = 3
+M = 4
+```
+##### Output
+```plaintext
+* * * *
+* * * *
+* * * *
+```
+#### PseudoCode
+```java
+function pattern(int N,int M){
+ for(int i = 1 ; i <= N ; i ++ ){
+ for(int j = 1 ; j <= M ; j ++ ){
+ system.out.print(' * ');
+ }
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 4
+
+Given **N** as input, print a staircase pattern of size **N**.
+
+#### TestCase
+
+##### Input
+```plaintext
+5
+```
+##### Output
+```plaintext
+*
+* *
+* * *
+* * * *
+* * * * *
+```
+#### Observation
+The key observation here is that:
+* The staircase pattern formed the right-angled triangle.
+* The number of stars in each row is equal to the row number.
+
+
+| Row | Stars |
+|:---:|:-----:|
+| 1 | 1 |
+| 2 | 2 |
+| 3 | 3 |
+| 4 | 4 |
+
+
+#### PseudoCode
+```java
+function pattern(int N){
+ for(int i = 1 ; i <= N ; i ++ ){
+ for(int j = 1 ; j <= i ; j ++ ){
+ system.out.print(' * ');
+ }
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 5
+
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+N = 3
+```
+##### Output 1
+```plaintext
+*
+* 2
+* 2 *
+```
+##### Input 2
+```plaintext
+N = 4
+```
+##### Output 2
+```plaintext
+*
+* 2
+* 2 *
+* 2 * 4
+```
+#### Observation
+The key observations are:
+* For even column numbers, print * .
+* For odd column numbers, print the column number.
+#### PseudoCode
+```java
+function pattern(int N){
+ for(int i = 1 ; i <= N ; i ++ ){
+ for(int j = 1 ; j <= i ; j ++ ){
+ if(j % 2 == 1) system.out.print(' * ');
+ else system.out.print(j);
+ }
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 6
+
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+N = 3
+```
+##### Output 1
+```plaintext
+* _ *
+* _ *
+* _ *
+```
+##### Input 2
+```plaintext
+N = 4
+```
+##### Output 2
+```plaintext
+* _ _ *
+* _ _ *
+* _ _ *
+* _ _ *
+```
+#### Observation
+The key observation here is that:
+* The first and last column number of each row is * .
+* There are total (N - 2) spaces in between stars( * ).
+
+
+#### PseudoCode
+```java
+function pattern(int N){
+ for(int i = 1 ; i <= N ; i ++ ){
+ system.out.print(' * ');
+ for(int j = 2 ; j <= N - 1 ; j ++ ){
+ system.out.print('_');
+ }
+ system.out.print(' * ');
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 7
+
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+N = 3
+```
+##### Output 1
+```plaintext
+* * *
+* *
+*
+```
+##### Input 2
+```plaintext
+N = 4
+```
+##### Output 2
+```plaintext
+* * * *
+* * *
+* *
+*
+```
+#### Observation
+As shown in above, the number of stars in each row is one less than the previous row except 1st row where number of stars is **N**. Hence, we can derive the formula:
+* Number of stars in each row is equal to the (N - rowNumber + 1).
+
+For N = 4,
+
+
+| Row | Stars |
+|:---:|:-----:|
+| 1 | 4 |
+| 2 | 3 |
+| 3 | 2 |
+| 4 | 1 |
+
+#### PseudoCode
+```java
+function pattern(int N){
+ for(int i = 1 ; i <= N ; i ++ ){
+ for(int j = i ; j <= N ; j ++ ){
+ system.out.print(' * ');
+ }
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 8
+
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+##### Input 1
+```plaintext
+N = 3
+```
+##### Output 1
+```plaintext
+* *
+* *
+* *
+```
+##### Input 2
+```plaintext
+N = 4
+```
+##### Output 2
+```plaintext
+* *
+* *
+* *
+* *
+```
+#### Observation
+The key observation here is that:
+* The first and last character of each row is ' * '.
+* Number of spaces in each row is one less than the previous row except first row where number of spaces between stars is **N - 1**. Hence we can say that there are total (N - rowNumber) spaces in between stars( * ).
+
+
+For N = 4,
+
+
+| Row | Total number of spaces between stars |
+|:---:|:-----:|
+| 1 | 3 |
+| 2 | 2 |
+| 3 | 1 |
+| 4 | 0 |
+
+
+#### PseudoCode
+```java
+function pattern(int N) {
+ for (int i = 1; i <= N; i++) {
+ system.out.print(' * ');
+ for (int j = 1; j <= N - i; j++) {
+ system.out.print(' ');
+ }
+ system.out.print(' * ');
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 9
+
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+
+##### Input 1
+```plaintext
+N = 3
+```
+##### Output 1
+```plaintext
+ *
+ * *
+* * *
+```
+##### Input 2
+```plaintext
+N = 4
+```
+##### Output 2
+```plaintext
+ *
+ * *
+ * * *
+* * * *
+```
+#### Observation
+The key observation here is that:
+* Number of spaces in each row is one less than the previous row except 1st row where number of spaces are **N - 1**. Hence we can say that there are total (N - rowNumber) spaces in the starting of each row.
+* Number of sars in each row is one more than the previous row except 1st row where number of stars are **1**. Hence we can say that there are total (rowNumber) stars at the last of each row.
+
+
+For N = 4,
+
+
+| Row | Total number of spaces | Total number of stars |
+|:---:|:----------------------:|:---------------------:|
+| 1 | 3 | 1 |
+| 2 | 2 | 2 |
+| 3 | 1 | 3 |
+| 4 | 0 | 4 |
+
+
+
+#### PseudoCode
+```java
+function pattern(int N) {
+ for (int i = 1; i <= N; i++) {
+ for (int j = 1; j <= N - i; j++) {
+ system.out.print(' ');
+ }
+ for (int j = 1; j <= i; j++) {
+ system.out.print(' * ');
+ }
+ system.out.println();
+ }
+}
+```
+---
+## Question 10
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+##### Input 1
+```plaintext
+N = 4
+```
+##### Output 1
+```plaintext
+********
+*** ***
+** **
+* *
+```
+#### Observation
+The key observation here is that:
+* There are total (N - rowNumber + 1) stars in the begining and end of each row.
+* There are total ((rowNumber - 1) * 2) spaces between these stars.
+
+ For N = 4,
+
+
+| Row | Stars | Spaces | Stars |
+|:---:|:-----:|:------:|:-----:|
+| 1 | 4 | 0 | 4 |
+| 2 | 3 | 2 | 3 |
+| 3 | 2 | 4 | 2 |
+| 4 | 1 | 6 | 1 |
+
+#### PseudoCode
+```java
+function pattern(int N) {
+ for (int i = 1; i <= N; i++) {
+ for (int j = 1; j <= N - i + 1; j++) {
+ system.out.print(' * ');
+ }
+ for (int j = 1; j <= (i - 1) * 2; j++) {
+ system.out.print(' ');
+ }
+ for (int j = 1; j <= N - i + 1; j++) {
+ system.out.print(' * ');
+ }
+ system.out.println();
+ }
+}
+```
+
+---
+## Question 11
+
+Given **N** as input, print the pattern as shown below.
+
+#### TestCase
+##### Input 1
+```plaintext
+N = 4
+```
+##### Output 1
+```plaintext
+ *
+ ***
+ *****
+*******
+```
+#### Observation
+The key observation here is that:
+* Number of spaces in each row is one less than the previous row except 1st row where number of spaces are **N - 1**. Hence we can say that there are total (N - rowNumber) spaces in the starting of each row.
+* Number of stars in each row is two more than the previous row except 1st row where number of stars are **1**. Hence we can say that there are total ((rowNumber - 1) * 2 + 1) stars between these spaces.
+
+ For N = 4,
+
+
+| Row | Spaces | Stars | Spaces |
+|:---:|:-----:|:------:|:-----:|
+| 1 | 3 | 1 | 3 |
+| 2 | 2 | 3 | 2 |
+| 3 | 1 | 5 | 1 |
+| 4 | 0 | 7 | 0 |
+
+#### PseudoCode
+```java
+function pattern(int N) {
+ for (int i = 1; i <= N; i++) {
+ for (int j = 1; j <= N - i; j++) {
+ system.out.print(' ');
+ }
+ for (int j = 1; j <= (i - 1) * 2 + 1; j++) {
+ system.out.print(' * ');
+ }
+ for (int j = 1; j <= N - i + 1; j++) {
+ system.out.print(' ');
+ }
+ system.out.println();
+ }
+}
+```
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher Strings.md b/Academy DSA Typed Notes/Java Refresher/Refresher Strings.md
new file mode 100644
index 0000000..1643790
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher Strings.md
@@ -0,0 +1,279 @@
+# Refresher : Strings
+# Introduction to String
+
+---
+## Explanation
+
+Lets consider this following pseudo-code:
+
+```java
+System.out.print("Hello World")
+```
+
+The part ie "Hello World" is known as **string**.
+String is defined as the sequence of characters.
+
+Characters involves - [A - Z] , [a - z] , [0 - 9] , spaces, tabs, new line, **{@,#,$,...}**.
+
+
+### Examples
+
+* "abc123" - This is a string
+* "abc $ - This is **not** a string, as this dont have ending double quotes.
+* " 123 " - This is a string
+* 123 - This is **not** a string. This is an integer
+
+---
+## String VS Integer
+
+"123" is a string but `123` is an integer. On string we apply operations like concatanation, length ,etc. In integer, we apply addition, multiplication,etc.
+
+The basic difference in string and integer is in the operations we do on them.
+
+---
+## String in Computers
+### Explanation
+
+The computers only understands binary, which is base 2. All the numbers which is base 10 is converted to binary so that computers understands it.
+
+All the texts, pictures, audios , etc are similarly converted to numbers in computers.
+
+Lets suppose we have a string "xyz" and in computer x is denoted by the number a, y is by b and z is by c. So we can say that "xyz" is represented by the number [ a b c].
+
+
+But there is no inherent rule of mapping, all this is done by assumption, which creates a problem. So to make things uniform, ASCII standard is implemented.
+
+---
+## ASCII
+### Explanation
+
+ASCII, in full American Standard Code for Information Interchange, a standard data-encoding format for electronic communication between computers. ASCII assigns standard numeric values to letters, numerals, punctuation marks, and other characters used in computers.
+
+The ASCII table looks like this:-
+
+
+
+> The learners are not required to remember this.
+
+---
+## ASCII
+### Explanation
+
+Suppose we have a string:
+
+```java
+String country = "India";
+```
+
+We assume String is an array of characters, hence it is comprehended as:
+
+```java
+"India" -> ['I', 'n', 'd', 'i', 'a']
+```
+
+Length of string is given by
+
+```java
+str.length()
+```
+
+If we want to access the i-th character of the string, we use:
+
+```java
+str.charAt(index)
+```
+
+### Question - 1
+
+Given a String, print its characters in new line
+
+**Input:**
+
+```java
+String -> "India"
+```
+
+**Output:**
+```plaintext
+ I
+ n
+ d
+ i
+ a
+```
+
+**Approach:** Iterate through each character in the string using a for loop and print it on a new
+
+**Code:**
+
+```java
+for(int i = 0; i < country.length(); i++) {
+ System.out.println(country.charAt(i));
+}
+```
+
+### Question - 2
+Given a String, print the ASCII of its characters in new line
+
+**Input:**
+
+```java
+String -> "India"
+```
+
+**Output:**
+```plaintext
+ 73
+ 110
+ 100
+ 105
+ 97
+```
+
+> Hint : Java understands characters as numbers
+
+**Approach:** Iterate through each character in the string, cast it to an integer to get its ASCII value, and then print that value on a new line.
+
+**Code:**
+
+```java
+String str = "India";
+for(int i = 0; i < str.length(); i++) {
+ System.out.println((int)str.charAt(i));
+}
+```
+
+### Question - 3
+
+Given a String, print the count of upper-case characters
+
+**Input:**
+
+```java
+String -> "kjRS78q31@3 Q"
+```
+
+**Output:** 3
+
+> Hint 1 : A-Z = $65 - 90$
+> Hint 2 : You don't need Hint 1
+
+
+**Approach:** The approach iterates over each character of the string str. For each character, it checks if it falls within the ASCII range for uppercase letters ('A' to 'Z'). If so, it increments the counter cnt. At the end, the total count of uppercase characters is printed.
+
+**Code:**
+
+```java
+int cnt = 0;
+String str = "kjRS78q31@3 Q";
+for(int i = 0; i < str.length(); i++) {
+ char c = str.charAt(i);
+ if(c >= 'A' && c <= 'Z') {
+ cnt++;
+ }
+}
+System.out.println("Count of uppercase chars is " + cnt);
+```
+
+### Question - 4
+
+Given a String, print the count of special characters
+**Input:**
+
+```java
+String -> "kjRS78q31@3 Q"
+```
+**Output:** 2
+
+> Special Characters means non numeric
+
+
+**Approach:** The code iterates over each character of the string str. For each character, it checks if it's neither a number, nor an uppercase letter, nor a lowercase letter (i.e., it's a special character). If so, it increments the counter cnt. The final count represents the number of special characters.
+
+**Code:**
+
+```java
+public static int specialChars(String str) {
+ int cnt = 0;
+ for(int i = 0; i < str.length(); i++) {
+ char c = str.charAt(i);
+ if(
+ !(c >= '0' && c <= '9') &&
+ !(c >= 'A' && c <= 'Z') &&
+ !(c >= 'a' && c <= 'z')
+ ) {
+ cnt++;
+ }
+ }
+ return cnt;
+}
+```
+
+
+### Question - 5
+
+Given a string, return the string in reverse
+
+**Input:** : "Aarnav"
+**Output:** "vanraA"
+
+
+
+* **Approach 1:** For each character in the string (from front to back), prepend it to the result. This builds the reversed string from front to back.
+```java
+ans = ""
+ ans = 'A' + ans = 'A' + "" = "A"
+ ans = 'a' + ans = 'a' + "A" = "aA"
+ ans = 'r' + ans = 'r' + "aA" = "raA"
+ .
+ .
+ ans = 'v' + ans = 'v' + "anraA" = "vanraA"
+```
+* **Approach 2:** For each character in the string (from back to front), append it to the result. This builds the reversed string from back to front.
+
+```java
+ans = ""
+ ans = "" + 'v' = "v"
+ ans = "v" + 'a' = "va"
+ .
+ .
+ .
+ ans = "vanra" + 'A' = "vanraA"
+```
+
+**Code:**
+
+```java
+public static String reverse(String str) {
+ String ans = "";
+ for(int i = 0; i < str.length(); i++) {
+ ans = str.charAt(i) + ans;
+ }
+ return ans;
+ }
+```
+
+### Question - 6
+
+Given a String, check whether its a palindrome
+
+**Palindrome** - A string which reads the same from front and back
+
+**Examples** - madam, maam, malayalam, dad, mom, racecar, nitin
+
+> Hint: Re-use previous reverse code
+
+**Approach:** Reverse the given string and compare it with the original. If they are identical, then the string is a palindrome.
+
+**Code:**
+
+```java
+public static boolean isPalindrome(String str) {
+ String rev = reverse(str);
+ if (str.equals(rev)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+```
diff --git a/Academy DSA Typed Notes/Java Refresher/Refresher While Loop.md b/Academy DSA Typed Notes/Java Refresher/Refresher While Loop.md
new file mode 100644
index 0000000..5178465
--- /dev/null
+++ b/Academy DSA Typed Notes/Java Refresher/Refresher While Loop.md
@@ -0,0 +1,561 @@
+# Refresher : While Loop
+## While Loop
+
+
+### Example
+* Say we need to print "Hello" 5 times.
+* We can do it as :-
+```cpp
+System.out.print("Hello");
+System.out.print("Hello");
+System.out.print("Hello");
+System.out.print("Hello");
+System.out.print("Hello");
+```
+* But what if we have to do the same 100 times or 1000 times ?
+* It would be not feasible.
+* Solution to above is to use **while loop** :-
+```cpp
+int count = 0 ;
+
+while(count < 5)
+{
+ System.out.print("Hello");
+ count ++ ;
+}
+```
+
+#### Syntax
+```cpp
+intialization
+
+while(Condition)
+{
+ // loop work
+ updation
+}
+```
+
+
+---
+### Question
+
+```
+int i = 1;
+i = i + 1;
+```
+
+What is the new value of i ?
+
+**Choices**
+
+- [x] 2
+- [ ] 1
+- [ ] 0
+- [ ] 3
+
+**Solution**
+
+```plaintext
+i = 1
+i = i + 1 => i = 1 + 1 = 2
+```
+
+---
+## Question 1
+
+
+### Question
+Given an integer N as input. Print from 1 to N ?
+
+#### Testcase 1
+
+```plaintext
+Input :
+N = 4
+```
+
+#### Solution 1
+`Output : 1 2 3 4`
+
+#### Approach
+* Intialize the count with 1.
+* While loop will execute till count <= N.
+* Print count.
+* In loop update the count by increamenting 1.
+
+#### Code
+```cpp
+public static void main(){
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int count = 1;
+ while (count <= N) {
+ System.out.printLn(count + " ");
+ count++ ;
+ }
+}
+```
+
+---
+## Question 2
+
+### Question
+Given an integer N as input. Print from N to 1 ?
+
+#### Testcase 1
+
+```plaintext
+Input :
+N = 4
+```
+#### Solution 1
+`Output : 4 3 2 1`
+
+#### Approach
+* Intialize the count with N.
+* While loop will execute till count >= 1.
+* Print count.
+* In loop update the count by decreamenting it by 1.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int count = N;
+ while (count >= 1) {
+ System.out.print(count + " ");
+ count--;
+ }
+}
+```
+
+---
+## Question 3
+
+### Question
+Given an integer N as input. Print odd values from 1 to N ?
+#### Testcase 1
+
+```plaintext
+Input : N = 8
+```
+#### Solution 1
+```plaintext
+Output : 1 3 5 7
+```
+#### Approach
+* Since odd numbers start from 1, intialize the count with 1.
+* While loop will execute till count <= N.
+* print count.
+* In loop update the count by increamenting it by 2 since adding 2 to previous odd will yeild next odd number.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int count = 1;
+ while (count <= N) {
+ System.out.print(count + " ");
+ count += 2;
+ }
+}
+```
+
+
+
+---
+## Question 4
+
+
+### Question
+Given an integer N as input. Print odd values from 1 to N ?
+
+
+#### Testcase 1
+
+```plaintext
+Input :
+N = 8
+```
+#### Solution 1
+`Output : 1 3 5 7`
+
+#### Approach
+* Since odd numbers start from 1, intialize the count with 1.
+* While loop will execute till count <= N.
+* print count.
+* In loop update the count by increamenting it by 2 since adding 2 to previous odd will yeild next odd number.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int count = 1;
+ while (count <= N) {
+ System.out.print(count + " ");
+ count += 2;
+ }
+}
+```
+
+---
+## Question 5
+
+
+### Question
+Given an integer N as input, print multiples Of 4 till N ?
+
+#### Testcase 1
+```plaintext
+Input : N = 18
+```
+
+#### Solution 1
+```plaintext
+Output : 4 8 12 16
+```
+
+#### Approach
+* Since multiple of 4 numbers start from 4, intialize the count with 4.
+* While loop will execute till count <= N.
+* Print count.
+* In loop update the count by increamenting it by 4 since adding 4 to previous multiple will yeild the next multiple.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int count = 4;
+ while (count <= N) {
+ System.out.print(count + " ");
+ count += 4;
+ }
+}
+```
+
+---
+
+
+### Question
+```cpp
+int i = 1;
+while (i <= 10) {
+ i = i * i;
+ System.out.print(i + " ");
+ i++;
+}
+```
+What will be the output ?
+
+**Choices**
+
+- [x] 1 4 25
+- [ ] Error
+- [ ] Infinite loop
+- [ ] 100 12 34
+
+**Solution**
+
+```plaintext
+|i = 1 | i <= 10 | i * i = 1 | i++ = 2 |---> iteration 1
+|i = 2 | i <= 10 | i * i = 4 | i++ = 5 |---> iteration 2
+|i = 5 | i <= 10 | i * i = 25 | i++ = 26 |---> iteration 3
+```
+
+---
+### Question
+
+```java
+public static void main() {
+ int i = 0;
+ while (i <= 10) {
+ System.out.print(i + " ");
+ i = i * i;
+ }
+}
+```
+
+What will be the output ?
+
+**Choices**
+
+- [x] Loop will never end
+- [ ] 1 4 9 16 25 36 49 64 81 100
+- [ ] 1 2 3 4
+- [ ] 0 0 0 0
+
+**Solution**
+
+```plaintext
+Since i would always be less than 10 hence infinite loop
+```
+
+---
+## Question 6
+
+
+### Question
+Q5 : Given an integer N as input, print perfect squares till N ?
+> Perfect square —> An integer whose square root is an integer
+
+#### Testcase 1
+
+```plaintext
+Input : N = 30
+```
+#### Solution 1
+```plaintext
+Output : 1 4 9 16 25
+```
+
+#### Approach
+* Intialize count = 1
+* While loop will execute till count * count <= N.
+* Print count * count.
+* In loop update the count by increamenting it by 1.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int count = 1;
+ while (count * count <= N) {
+ System.out.print(count * count + " ");
+ count += 1;
+ }
+}
+```
+
+---
+## Question 7
+
+### Question
+Given an integer N as input, print it's digits ?
+
+#### Testcase 1
+
+```plaintext
+Input : N = 6531
+```
+#### Solution 1
+```plaintext
+Output : 1 3 5 6
+```
+#### Observations
+
+
+| N | N % 10 |
+|:----:|:----:|
+| 6531 | 1 |
+| 653 | 3 |
+| 65 | 5 |
+| 6 | 6 |
+
+* We can see that answer to % 10 of numbers present in the table coincide with the answer.
+* We need to find a way to arrive at these numbers while iterating.
+* We can do this by dividing number in each iteration by 10.
+
+| N | N/10 |
+|:----:|:----:|
+| 6531 | 653 |
+| 653 | 65 |
+| 65 | 6 |
+| 6 | 0 |
+
+
+#### Approach
+* Input N.
+* While loop will execute till N > 0.
+* Print N % 10.
+* In loop update the N by dividing it by 10.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ while (N > 0) {
+ System.out.print(N + " ");
+ N /= 10;
+ }
+}
+```
+
+### Edge Cases
+**TestCase 1**
+```plaintext
+Input :-
+N = 0
+```
+**Solution 1**
+```plaintext
+Output = 0
+```
+**Approach** to handle edge case -
+* Input N.
+* While loop will execute till N >= 0.
+* Print N % 10.
+* In loop update the N by dividing it by 10.
+
+**Code 1**
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ while (N >= 0) {
+ System.out.print(N + " ");
+ N /= 10;
+ }
+}
+```
+* The above approach leads to **infinite loop**.
+* We need to handle above case seperately in if else.
+
+
+**TestCase 2**
+```plaintext
+Input :-
+N = - 6351 (i.e N < 0)
+```
+**Solution 2**
+```plaintext
+Output : 1 3 5 6
+```
+
+* Since answer of N < 0 would be same as that of N > 0.
+* So we just multiple N with -1 in order to convert it to +ve number .
+
+#### Code final
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ if (N == 0) {
+ System.out.print(0);
+ } else {
+
+ if (N < 0) {
+ N *= -1;
+ }
+ while (N > 0) {
+ print(N + " ")
+ N /= 10;
+ }
+ }
+}
+```
+
+---
+## Question 8
+
+
+### Question
+Given an integer N as input, print sum of it's digits ?
+> N > 0
+
+#### Testcase 1
+
+```plaintext
+Input : N = 6531
+```
+#### Solution 1
+```plaintext
+Output : 15
+```
+
+#### Approach
+
+* Input N & Intialize sum = 0
+* While loop will execute till N > 0.
+* Add N % 10 to sum.
+* In loop update the N by dividing it by 10.
+
+#### Pseudeocode
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int Sum = 0;
+ while (N > 0) {
+ Sum += (N % 10);
+ N /= 10;
+ }
+ System.out.print(Sum);
+}
+```
+
+---
+
+### Question
+Which of the following will add the digit `d` to the back of a number `r`
+
+**Choices**
+
+- [x] r * 10 + d
+- [ ] d * r
+- [ ] d + r
+- [ ] d * 10 + r
+
+**Solution**
+
+```plaintext
+Let r = 13 & d = 4
+We want to add d behind r i.e we need number 134
+So r * 10 = 130
+r * 10 + d => 130 + 4 = 134
+```
+
+---
+## Question 9
+
+
+### Question
+Given an integer N as input, Reverse it ?
+> N > 0
+
+#### Testcase 1
+
+```plaintext
+Input :
+N = 6531
+```
+#### Solution 1
+`Output : 1356`
+
+#### Approach
+* Input N & Intialize reverse = 0
+* While loop will execute till N > 0.
+* Set reverse = reverse * 10 + N % 10.
+* In loop update the N by dividing it by 10.
+
+#### Code
+```cpp
+public static void main() {
+
+ Scanner scn = new Scanner(System.in);
+ int N = scn.nextInt();
+ int reverse = 0;
+ while (N > 0) {
+ d = N % 10;
+ reverse = reverse * 10 + d;
+ N /= 10;
+ }
+ System.out.print(reverse);
+}
+```
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Introduction To Python and Data Types.md b/Academy DSA Typed Notes/Python Refresher/Refresher Introduction To Python and Data Types.md
new file mode 100644
index 0000000..e6f124e
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Introduction To Python and Data Types.md
@@ -0,0 +1,1464 @@
+# Refresher: Introduction To Python and Data Types
+
+---
+### Intermediate Refresher Module Description
+
+
+* Refresher: Introduction To Python and Data Types
+* Refresher: Operators and Control Statements
+* Refresher: Iteration 1
+* Refresher: Iteration 2
+* Refresher: Functions
+* Refresher: List 1
+* Refresher: List 2
+* Refresher: List 3
+* Refresher: Tuples + Strings 1
+* Refresher: Strings 2
+* Refresher: Sets and Dictionaries
+* Refresher Practice Test
+ * Will be given more information later on
+
+Let's Begin with the Content!
+
+---
+### Agenda for Today!
+
+
+1. Basics of Python
+ * Interpreter
+ * First Program
+ * Case Sensitive
+3. Arithmetic Calculations
+4. Data Types
+5. Variables
+6. Comments
+7. Type Casting
+8. Lots of Quizzes Quizzes
+9. Dashboard Walkthrough
+
+---
+## Introduction to Python
+
+* Python is a high-level language and it is a very simple language.
+* Python is one of the most used languages.
+
+---
+## Python Interpreter
+For the Python interpreter, we do not need to install any extra software in our system.
+* You just need to open our browser.
+* Search Colab Google in the browser and open the first link.
+* Create a new notebook.
+* Now blank environment will be opened on your screen.
+* You can simply write code on it and run it.
+
+
+
+---
+## First Python Program
+
+We will write the first program to print Hello World
+```python
+print("Hello World")
+```
+
+Then we will run it, then colab will automatically run it, we do not need to install Python explicitly.
+
+
+**Output:**
+```plaintext
+Hello World
+```
+
+But colab sometimes works slowly, so we can also use jupyter notebook for Python programs.
+
+We have learnt one thing from the above program:
+- Anything written in `" "` will be printed as it is in output.
+
+Let us try to run one more code
+
+```python
+print("Hi how are you?")
+```
+
+It will print Hi how are you? as it is.
+
+**Output:**
+```plaintext
+Hi how are you?
+```
+
+If we try to print any random content by `print()`, then that will also be printed as it is:
+
+
+```python
+print("hjasghkjelf2176189*4#$sljhadsfghbdas")
+```
+
+
+**Output:**
+```plaintext
+hjasghkjelf2176189*4#$sljhadsfghbdas
+```
+
+
+---
+### Question
+
+What will be the output of this code snippet?
+`print("10")`
+
+**Choices**
+
+- [x] 10
+- [ ] "10"
+- [ ] ten
+- [ ] Error
+
+**Explanation**
+
+`print()` will not print `""`, it only prints the content written inside it.
+
+So `print("10")` will print only `10` as output.
+
+
+If we do not write `" "` in print then it will print the variable value.
+
+```python
+print(10)
+```
+
+**Output:**
+```plaintext
+10
+```
+
+If we do not write `" "` in print then it will perform arithmetic calculation.
+
+```python
+print(10 + 30)
+```
+
+**Output:**
+```plaintext
+40
+```
+
+If we write `" "` in print then it will perform string concatenation.
+
+```python
+print("10" + "30")
+```
+
+**Output:**
+```plaintext
+1030
+```
+
+---
+### Question
+
+Predict the output
+`print("10 + 10")`
+
+**Choices**
+
+- [ ] 20
+- [ ] "10 + 10"
+- [x] 10 + 10
+- [ ] Error
+
+
+**Explanation**
+
+Whatever will be written in `""`, python will print it as it is without changing anything in it, so it will not perform any addition and print it as it is.
+
+So `print("10 + 10")` will print only `10 + 10` as output.
+
+---
+## Python Is a Case-Sensitive Language
+
+The computer is a very dumb machine, it does not understand instructions, as normal people do so If I say what is 10 + 20 then you will say 30, then if I ask you to spell it, you will say `t h i r t y`, but programming language does not do like that.
+- Programming language is hardware-driven it will do the things that are programmed only.
+
+
+If we write `prent()` instead of `print()`, then normal people can understand it is a `print()` and a person wants to print something, but Python would not understand.
+Also, we forgot to add parentheses in the print statement, then also we got an error.
+
+
+
+---
+## Arithmetic Calculations in print()
+
+- We can do substractions in `print()`.
+```python
+print(10 - 1)
+```
+
+**Output:**
+```plaintext
+9
+```
+
+- We can also do multiplications in `print()`.
+```python
+print(10 * 2)
+```
+
+**Output:**
+```plaintext
+20
+```
+
+
+---
+### Question
+
+`print(10 + 20)`
+
+**Choices**
+
+- [x] 30
+- [ ] 30.00
+- [ ] 33
+
+
+---
+### Question
+
+What is the output of the following piece of code?
+`Print(10 * 22)`
+
+**Choices**
+
+- [ ] 220
+- [ ] 2200
+- [x] Error
+- [ ] 10 * 22
+
+
+**Explanation**
+
+Here we have `Print(10 * 22)` and Python is a case-sensitive language, so it will not understand print with `P` and it will throw a `NameError`.
+
+---
+### Question
+
+What is the output of the following piece of code?
+`print(8 * 6)`
+
+**Choices**
+
+- [ ] 54
+- [x] 48
+- [ ] 8 * 6
+- [ ] 86
+
+
+---
+## Primitive data types in Python
+Every data is in a certain form, for example, a name is a String.
+
+Let us take an example of **Student details**,
+- **Name: string**, we never name as 1, 2, etc, it will always be a string.
+- **Roll number: integer**
+- **marks: decimal(float)**, marks can be decimal value as sometimes there may be half marks
+- **is_absent: True/false**, the student is absent or present, so it is a boolean value.
+
+**Data types:** is a type of data we have in Python programming language.
+
+In Python, we have a function named `type`, if we pass any data to it, it will print the type of that data.
+
+
+### Integer:
+
+**For example:**
+```python=
+print(type(23))
+```
+
+**Output:**
+```plaintext
+
+```
+
+It is an integer value so it will print `int`, just ignore the class part.
+
+
+**Example:**
+```python=
+print(type(-122))
+```
+
+**Output:**
+```plaintext
+
+```
+
+-122 is also an integer.
+
+**So integer can be any numeric value from - infinity to + infinity without a decimal in it.**
+
+
+### Float
+
+**If we add a decimal into the integer then it will be a float**.
+
+**For example:**
+
+```python
+print(type(12.5))
+```
+
+**Output:**
+```plaintext
+
+```
+
+**Example:**
+```python
+print(type(12.0))
+```
+
+**Output:**
+```plaintext
+
+```
+
+If we add `.0`, then also it is considered as a floating number.
+
+
+### String
+
+
+Any value inside double inverted `" "`, or single inverted `' '` commas will be considered as a string.
+
+
+```python
+print(type("abcd"))
+```
+
+**Output:**
+```plaintext
+
+```
+
+**Example:**
+```python
+print(type('abcd'))
+```
+
+**Output:**
+```plaintext
+
+```
+
+But you can't do it in a way that starts with a single inverted and ends with double inverted commas. It will give us a syntax error.
+
+**Example:**
+```python
+print(type('abcd"))
+```
+
+**Output:**
+```plaintext
+ERROR!
+File "", line 1
+ print(type('abcd"))
+ ^
+SyntaxError: unterminated string literal (detected at line 1)
+```
+Either use both single inverted commas or both double inverted commas.
+
+### Multi-line strings
+
+If we write any paragraph or multiple line strings, then it is also considered as a string
+
+**Example:**
+```python
+print(type(
+"""
+Hey!!!
+Welcome everyone
+"""
+))
+```
+
+**Output:**
+```plaintext
+
+```
+
+### Boolean
+There are two boolean values, True and False, and True means 1 and False means 0.
+
+
+**Example:**
+```python
+print(type(True))
+print(type(False))
+```
+
+**Output:**
+```plaintext
+
+
+```
+
+
+## None
+If we print the type of `None`, then it will be `NoneType`.
+
+**Example:**
+```python
+print(type(None))
+```
+
+**Output:**
+```plaintext
+
+```
+
+
+
+---
+### Question
+
+What will be the output of the following?
+`print(type(true))`
+
+**Choices**
+
+- [ ] True
+- [ ] False
+- [ ] Bool
+- [x] Error
+
+
+---
+### Question
+
+What is the output of the following piece of code?
+`print(type(5.0))`
+
+**Choices**
+
+- [ ] int
+- [x] float
+- [ ] str
+- [ ] bool
+
+---
+### Question
+
+What is the output of the following?
+`Print(type(False))`
+
+**Choices**
+
+- [ ] bool
+- [ ] int
+- [ ] str
+- [x] Error
+
+**Explanation**
+
+```python
+Print(type(False))
+```
+Here `p` is capital P in print so it gives an error.
+
+
+---
+## Comments
+A comment is a way to explain what a code does. In Python comments start with the symbol `#`.
+- Anything written in comments would not get run.
+
+**Example:**
+```python
+# print('hello world')
+
+```
+
+Nothing will be printed in the output, as we have commented print statement.
+
+### Multi-line comments
+If we want multi-line comments in Python, then we need to write the `#` symbol in every line.
+
+**Example:**
+```python
+# this
+# is
+# a multi-line comment
+```
+
+You can also make multi-line comments by writing multi-line strings.
+
+**Example:**
+```python
+"""
+this
+is
+a multi-line comment
+"""
+```
+
+
+
+---
+## Variables
+Variables are like containers, which allow to store values, or we can say variables are like storage.
+
+**Example:**
+```python
+a = 10
+```
+Here `a` is a variable.
+
+We can also change the value of `a`.
+
+**Example:**
+```python
+a = 10
+a = 20
+```
+
+But when we print the value of `a`, it will print the latest value of `a`.
+
+
+**Example:**
+```python
+a = 10
+a = 20
+
+print(a)
+```
+
+**Output:**
+```plaintext
+20
+```
+
+And if we check the type of variable `a`, then it will be an integer.
+
+**Example:**
+```python
+a = 10
+a = 20
+
+print(a)
+
+print(type(a))
+```
+
+**Output:**
+```plaintext
+20
+
+```
+
+**In Python, variables take the type of their value**
+So if we assign a float value to a variable, then its type becomes float.
+
+
+**Example:**
+```python
+pi = 3.14
+
+print(type(pi))
+```
+
+**Output:**
+```plaintext
+
+```
+
+### Rules for Naming Variables in Python
+1. A variable name must start with a letter(a-z, A-Z) or the underscore(_) character.
+2. A variable name cannot start with a number.
+3. A variable name can only contain alpha-numeric characters and underscores(means can only have A-Z, a-z, 0-9, and _ ).
+4. Variable names are case-sensitive (age, Age and AGE are three different variables).
+
+`a1s = 1`, is the correct variable as it starts with a character, does not start with a number, it only has alphanumeric characters and underscores.
+
+**Example for last rule:**
+```python
+a = 1
+A = 2
+print(a)
+print(A)
+```
+
+**Ouput:**
+```plaintext
+1
+2
+```
+Both a will be treated differently and print their values.
+
+
+
+
+---
+### Question
+
+Which of the following is a valid variable name?
+
+
+**Choices**
+
+- [x] hELLO
+- [ ] 1_name_Input
+- [ ] `a * b * c`
+- [ ] Cod3$#
+
+
+
+---
+## Cases for Variables
+
+Cases are just a way to write variables.
+Let us assume we want to create a variable for storing Shubham marks, then we can have
+
+**Camel Case:**
+```python
+shubhamMarks = 10
+```
+
+**Title Case:**
+```python
+ShubhamMarks = 10
+```
+
+But in the above two cases, the camel case is preferred more.
+
+**Snake Case:**
+```python
+shubham_marks = 10
+```
+
+**Example:**
+```python
+thisisavariable = 1234
+thisIsAVariable = 1234 # It is more readable in comparison to the above variable name
+this_is_a_variable = 4567 # can have an underscore in a variable name
+print(thisIsAVariable)
+print(this_is_a_variable)
+```
+
+**Output:**
+```plaintext
+1234
+4567
+```
+
+
+---
+## Type Casting
+Casting is converting a variable of one type to another type. For example, if we have some value in a string, but we want it in an integer or float, then we need type casting.
+
+
+### Converting String To integers
+If we have some integer value in string form, but we want to convert it to an integer for performing some arithmetic operations, then we have a `int()` function for it.
+
+For converting string to integer, we just need to wrap in `int()`.
+
+**Example:**
+```python
+# Converting String
+# To integers
+a = "1234"
+b = int(a)
+print(type(b))
+```
+
+**Output:**
+```plaintext
+
+```
+
+But if we try to convert a string have some string value into an integer then it will give an error.
+
+
+**Example:**
+```python
+a = "welcome"
+b = int(a)
+print(type(b))
+```
+
+**Output:**
+```plaintext
+ValueError Traceback (most recent call last)
+Cell In[48], line 2
+ 1 a = "welcome"
+----> 2 b = int(a)
+ 3 print(type(b))
+ValueError: invalid literal for int() with base 10: 'welcome'
+```
+
+
+**Example:**
+```python
+a = "12a"
+b = int(a)
+print(type(b))
+```
+
+**Output:**
+```plaintext
+ValueError Traceback (most recent call last)
+Cell In[48], line 2
+ 1 a = "12a"
+----> 2 b = int(a)
+ 3 print(type(b))
+ValueError: invalid literal for int() with base 10: '12a'
+```
+
+### Converting String To Float
+
+For converting string to float, we just need to wrap in `float()`.
+
+**Example:**
+```python
+# Converting String
+# To float
+a = "12"
+b = float(a)
+print(type(b))
+```
+
+**Output:**
+```plaintext
+
+```
+
+**Example:**
+```python
+a = "12.5"
+b = float(a)
+print(b)
+print(type(b))
+
+```
+
+**Output:**
+```plaintext
+12.5
+
+```
+
+But if we have two decimal points in the string, then it will give an error.
+
+
+**Example:**
+```python
+a = "12.5.0"
+b = float(a)
+print(type(b))
+print(b)
+
+```
+
+**Output:**
+```plaintext
+ValueError Traceback (most recent call last)
+Cell In[53], line 2
+ 1 a = "12.5.0"
+----> 2 b = float(a)
+ 3 print(type(b))
+ 4 print(b)
+ValueError: could not convert string to float: '12.5.0'
+```
+
+
+### Converting String To Bool
+Converting string to bool is a little tricky:
+- Empty string is False,
+- Everything else is True.
+
+`bool()` will convert string to bool.
+
+**Example:**
+```python
+a = ""
+b = bool(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+False
+```
+
+
+If we even write space in a string, then also its bool value will be true.
+
+**Example:**
+```python
+a = " "
+b = bool(a)
+print(type(b))
+print(b)
+
+```
+
+**Output:**
+```plaintext
+
+True
+```
+
+
+
+### Converting Integer To String
+`str()` is used for converting Integer To String.
+
+**Example:**
+```python
+a = 1234
+b = str(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+1234
+```
+
+
+If the integer value is 0, then also it will be converted to a string.
+
+**Example:**
+```python
+a = 0
+b = str(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+0
+```
+
+### Converting Integer To Float
+
+`float()` is used for converting an integer to float, and it will simply add `.0` to the integer value for converting it into float.
+
+**Example:**
+```python
+a = 1234
+b = float(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+1234.0
+```
+
+
+
+### Converting Integer To Bool
+
+`bool()` is used for converting an integer to bool,
+- 0 is False,
+- Everything else is True.
+
+**Example:**
+```python
+a = 1234
+b = bool(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+True
+```
+
+Negative value is also True, as 0 is only False.
+
+**Example:**
+```python
+a = -1
+b = bool(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+True
+```
+
+
+
+
+### Converting Float To String
+`str()` is used for converting Float To String.
+
+**Example:**
+```python
+a = 3.14
+b = str(a)
+print(type(b))
+print(b)
+
+```
+
+**Output:**
+```plaintext
+
+3.14
+```
+
+### Converting Float To Integer
+
+`int()` is used for converting integers to float, and it will remove everything after decimal.
+
+**Example:**
+```python
+a = 3.14
+b = int(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+3
+```
+
+
+
+### Converting Float To Bool
+
+`bool()` is used for converting float to bool,
+- Everything that is 0.0 is False,
+- Everything else is True.
+
+**Example:**
+```python
+a = 0.00000001
+b = bool(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+True
+```
+
+Because `0.00000001` is also something value above `0.0`.
+
+
+### Converting Bool To Integer
+
+- True will be converted to 1.
+- False will be converted to 0.
+
+**Example:**
+```python
+a = True
+b = int(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+1
+```
+
+**Example:**
+```python
+a = False
+b = int(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+0
+```
+
+
+
+### Converting Bool To String
+
+- True will be converted to True in string.
+- False will be converted to False in the string.
+
+**Example:**
+```python
+a = False
+b = str(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+False
+```
+
+
+**Example:**
+```python
+a = True
+b = str(a)
+print(type(b))
+print(b)
+```
+
+**Output:**
+```plaintext
+
+True
+```
+
+
+---
+### Question
+
+What is the output of the following?
+`print(bool("0"))`
+
+**Choices**
+
+- [x] True
+- [ ] False
+- [ ] Error
+
+**Explanation**
+
+`print(bool("0"))`
+
+"0" is a string and only the empty string is false, everything else is true, here we have a string having some value so it will be True.
+
+
+
+---
+### Question
+
+What is the output of the following?
+`print(bool("apple"))`
+
+**Choices**
+
+- [x] True
+- [ ] False
+
+
+---
+### Question
+
+What is the output of the following?
+`# print("101")`
+
+**Choices**
+
+- [ ] 101
+- [ ] "101"
+- [x] Nothing
+- [ ] Error
+
+**Explanation**
+
+`# print("101")`
+
+Here this print statement is commented, so nothing will be printed in the output.
+
+
+
+---
+### Question
+
+What is the output of the following?
+`print(int(15.99))`
+
+**Choices**
+
+- [x] 15
+- [ ] 16
+- [ ] 15.99
+- [ ] Error
+
+
+---
+## Input Statement
+Not every value is always available in the program, many times we need to take the values input from the user.
+
+`input()` is used in Python for taking user from input.
+
+We can also pass the message in `input()` which will be printed for taking input from the user.
+
+**Example:**
+
+```python
+a = input()
+print(a)
+```
+
+**Output:**
+```plaintext
+67
+67
+```
+
+We can also pass the message "Enter an integer value "
+
+
+**Example:**
+
+```python
+a = input("Enter an integer value ")
+print(a)
+```
+
+**Output:**
+```plaintext
+Enter an integer value 67
+67
+```
+
+But it should not always be guaranteed that the user will enter an integer value, the user can also enter `ten` as input.
+
+So it's our responsibility to typecast the user input value according to our requirements.
+
+
+`input()` will always return a string value.
+
+
+**Example:**
+
+```python
+a = input("Enter an integer value ")
+print(a)
+print(type(a))
+```
+
+**Output:**
+```plaintext
+Enter an integer value 67
+67
+
+```
+
+If we enter any floating value, then it also be taken as a string.
+
+**Example:**
+
+```python
+a = input("Enter an integer value ")
+print(a)
+print(type(a))
+```
+
+**Output:**
+```plaintext
+Enter an integer value 67.7
+67.7
+
+```
+
+If we want to change the type of input value, then we have to do type casting.
+
+**Example:**
+
+```python
+a = input("Enter an integer value ")
+b = int(a)
+print(b)
+print(type(b))
+```
+
+**Output:**
+```plaintext
+Enter an integer value 12
+12
+
+```
+
+Now if the user gives string value as input then it will throw an error during type casting.
+
+
+**Example:**
+
+```python
+a = input("Enter an integer value ")
+b = int(a)
+print(b)
+print(type(b))
+```
+
+**Output:**
+```plaintext
+Enter an integer value john
+ValueError Traceback (most recent call last)
+Cell In[82], line 2
+ 1 a = input("Enter an integer value ")
+----> 2 b = int(a)
+ 3 print(b)
+ 4 print(type(b))
+ValueError: invalid literal for int() with base 10: 'john'
+
+```
+
+
+---
+## Problem Statement
+Take two numbers as input and print the sum of those numbers.
+
+### Solution
+
+1. First we need to take two input user
+```python
+a = input()
+b = input()
+```
+
+2. The next step is to do the sum of it.
+```python
+a = input()
+b = input()
+print(a + b)
+```
+
+**Output:**
+```plaintext
+10
+20
+1020
+```
+
+As `input()` will take everything as a string, so if we try to add input value, then the string concatenation will be performed by it.
+3. So we need to convert the input value into int first, and then we will add those values.
+```python
+a = int(input())
+b = int(input())
+print(a+b)
+```
+
+**Output:**
+```plaintext
+10
+20
+30
+```
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+b = input() # input value = 234
+print(type(b))
+```
+
+**Choices**
+
+- [ ] int
+- [x] string
+- [ ] not sure
+
+
+
+---
+### Extra - Print Statement
+
+**Example:**
+```python
+a = 10
+b = 20
+print(a, b)
+```
+
+**Output:**
+```plaintext
+10 20
+```
+
+**Example:**
+```python
+a = 10
+b = 20
+c = 30
+print(a, b)
+print(c)
+```
+
+**Output:**
+```plaintext
+10 20
+30
+```
+
+### Sep and End
+We can pass the `sep` and `end` values in the print statement.
+
+- **sep** is what should come between the values of the print statement.
+- **end:** is what should come after the print statement content.
+
+default value of sep is `' '`(space) and end is `\n`(new line character).
+
+**Example:**
+```python
+print(13, 134, 134, 1324,134, sep = ' ', end = '\n') #default values
+```
+
+**Output:**
+```plaintext
+13 134 134 1324 134
+```
+
+If we pass `-` as a separator value, then a dash will be added between the values.
+
+
+**Example:**
+```python
+print('John', 'Doe', sep = '-')
+```
+
+**Output:**
+```plaintext
+John-Doe
+```
+
+**Example:**
+```python
+a = 10
+b = 20
+print(a, b, sep = '@')
+```
+
+**Output:**
+```plaintext
+10@20
+```
+
+`\n` will work as a new line character, if we pass it as a separator then every value will be printed in a new line.
+
+
+**Example:**
+```python
+a = 10
+b = 20
+print(a, b, sep = '\n')
+```
+
+**Output:**
+```plaintext
+10
+20
+```
+
+If we pass `' '`(space) as a value of `end`, then after print statement values it will not go to a new line, it will simply add space after that.
+
+
+
+**Example:**
+```python
+a = 10
+b = 20
+c = 30
+print(a, b, end = ' ')
+print(c)
+print(40)
+```
+
+**Output:**
+```plaintext
+10 20 30
+40
+```
+
+In the above code, we have not mentioned any `sep` value, so it will be space automatically.
+
+
+**Example:**
+```python
+print(1, 2, 3, 4, sep = '-', end = '+')
+print(5)
+```
+
+**Output:**
+```plaintext
+1 - 2 - 3 - 4 + 5
+```
+
+
+---
+### Question
+
+What will the output of the following?
+```python
+a = 5
+b = 6
+print(a, b)
+```
+
+**Choices**
+
+- [ ] 56
+- [ ] 5
+ 6
+- [x] 5 6
+- [ ] Error
+
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 5
+b = 6
+print(a)
+print(b)
+```
+
+**Choices**
+- [ ] 56
+- [x] 5
+ 6
+- [ ] 5 6
+- [ ] Error
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+print("I", "Love", "Scaler", sep = "-")
+```
+
+**Choices**
+
+- [ ] I Love Scaler
+- [x] I-Love-Scaler
+- [ ] I-love-scaler
+- [ ] Error
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Iteration 1.md b/Academy DSA Typed Notes/Python Refresher/Refresher Iteration 1.md
new file mode 100644
index 0000000..659f005
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Iteration 1.md
@@ -0,0 +1,505 @@
+# Refresher: Iteration 1
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 3
+a *= 4
+print(a)
+```
+
+**Choices***
+
+- [ ] 3
+- [ ] 4
+- [ ] 7
+- [x] 12
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+a = 5
+if(a < 6):
+ print('Option 1')
+if(a < 3):
+ print('Option 2')
+else:
+ print('Option 3')
+```
+
+**Choices**
+
+- [ ] Option 1
+- [ ] Option 2
+- [ ] Option 3
+- [x] Option 1
+ Option 3
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+a = 1
+b = 0
+c = 1
+if ( a and b):
+ print("Option 1")
+elif (a and c):
+ print("Option 2")
+else:
+ print("Option 3")
+```
+
+**Choices**
+
+- [ ] Option 1
+- [x] Option 2
+- [ ] Option 3
+- [ ] Option 4
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+count = 0
+while(count < 10):
+ print(10, end = ' ')
+```
+
+**Choices**
+
+- [ ] 0 1 2 3 4 5 6 7 8 9
+- [ ] Infinite Loop
+- [x] 10 10 10 10 10 10 10 10 10 10
+
+
+
+
+---
+## Introduction
+* Imagine we wish to print the numbers from `1` to `1000`.
+* So we can write the code as follows:
+```python
+print(1)
+print(2)
+..
+..
+..
+print(1000)
+```
+* This is not an intelligent task to do. If the task is simple and we want to repeat it 5 times, we might write the same piece of code 5 times But this is not a practical approach if the repetition number is like `100` or `1000`.
+* There is a principle in programming called **DRY**
+
+
+Do you know the full form of it?
+* **Don't Repeat Yourself**
+* Even if you are writing the same code three times, you are not doing a good job at it. We can either use loops or functions.
+* Before seeing loops, let us see why Python does things in a certain way.
+* I have a friend Ramesh and I have to take `10` toffies from him. I will pick a chocolate and start counting from `1` until I reach `10` and then stop.
+* Let us see in code what we are doing. Each time in a loop we will check if condition until we reach the else part.
+
+
+```python
+count = 0
+if(count < 10):
+ take toffee
+ count += 1
+else
+ stop
+```
+
+
+* There are four things we always do in a loop:
+ 1. Initialization
+ 2. Condition
+ 3. Action
+ 4. Updation
+* We will discuss the `while` loop in this class and the `for` loop in the next as it is different in different programming languages.
+* The while loop will only run till the condition is true. As soon as the condition becomes false we exit the loop and execute the rest of the code.
+
+
+
+### Syntax
+
+```python
+variable initialization
+while (condition)
+{
+ action
+ update variable
+}
+```
+
+
+This can be read as while this condition is **true** perform this action and update the variable.
+
+Let us quickly move to an example to understand better.
+
+---
+## Print numbers from 1 to n
+
+
+### Example 1 - Print Numbers from 1 to n
+```python
+ n = input()
+ count = 1
+ while(count <= n): # can also be written as (count < n + 1)
+ print(count)
+ count += 1
+ print("end")
+```
+* Parenthesis are optional in while condition.
+* Dry run for n = 5
+
+If I do not write the incrementing `count` statement what will happen?
+
+It will fall in the infinite loop and `1` will be printed forever.
+
+* Always ensure you have all 4 things while writing a loop.
+* In any programming language all the loops will always have these four things.
+* An alternative way of writing this code is as follows:
+```python
+n = input()
+count = 0
+while count < n:
+ count += 1
+ print(count)
+```
+This is because counting in programming languages starts from `0`. Array indexing in most of the languages also starts from `0`. This is doing the same thing except the statements are shuffled.
+
+---
+## Print number from n to 1
+
+
+### Example 2 - Print Number From n to 1
+* Go grab your notebook, iPad, or laptop try writing code for the above question, and put the solution in the chat section.
+* Writing in a book is best practice.
+
+```python
+n = int(input())
+while n >= 1:
+ print(n)
+ n -= 1
+```
+
+* Dry run for n = 5
+
+
+---
+## Print even numbers from 1 to 100
+
+
+### Example 3 - Print Even Numbers From 1 to 100
+* Once done paste it into the chat section
+**Note:** Don't forget the updation of a variable. Also, some of the solutions have conditions where the loop doesn't run at all.
+```python
+n = int(input())
+count = 1
+while count <= n:
+ if count % 2 == 0:
+ print(count)
+ count += 1
+```
+* Write the updation statement in the beginning only.
+
+**Alternative Solution:**
+In each interaction, we can update the count by 2. Initially, instead of starting from 1, we can start from 2, and in each iteration, we can do `count += 2` this will always result in an even number.
+
+```python
+n = int(input()):
+count = 2
+while count <= n:
+ print(count)
+ count += 2
+```
+
+This is an optimization of the above code as we are not checking the condition as well as the loop will only run half the times of `n`.
+
+---
+## Print the sum of all even numbers from 1 to 20
+
+
+### Example 4 - Print the Sum of All Even Numbers From 1 to 20
+We already know how to generate even numbers between `1` to `20`.
+
+Instead of printing it, we need to store it in the bucket.
+
+So we can keep adding these to a number and return the sum at the end.
+```python
+sum = 0
+count = 2
+while(count <= n):
+ sum += count
+ count += 2
+print(sum)
+```
+
+---
+## Print the digits of number `459`
+
+
+### Example (VVIMP) - Print the Digits of Number 459 (order Doesn't Matter)
+* How to get digits of a number in iteration
+* Scraper -> extracts the last digit
+* Scissors -> Cuts the last digit
+
+
+We will scrape the last digit, print the result, and cut the last digit. This process is continued until all the digits are cut. This is a loop, right?
+
+
+Is there any operation I told you in the past which takes `459` and returns `9`?
+ * taking `% 10` (modulo 10) will return the last digit.
+ * `459 % 10 -> 9`
+ * `45 % 10 -> 5`
+ * `4 % 10 -> 4`
+
+Is there any operation that takes `459` and returns `45`, basically cutting the last digit?
+ * taking `/ 10` (integer division by 10) will return the last digit.
+ * `int(459 / 10) -> 45`
+ * `int(45 / 10) -> 4`
+ * `int(4 / 10) -> 0`
+
+Only division will give the floor value such as `45.9`. Also, `459 // 10` doesn't work with negative integers as `-459` will give `-45.9 -> -46`. Thus, we can simply use `int(val)` to get the integer part of the remaining number.
+```python
+n = int(input())
+while n > 0:
+ print(n % 10)
+ n = int(n / 10)
+```
+
+
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+print(149 % 10)
+```
+
+**Choices**
+
+- [ ] 14
+- [x] 9
+- [ ] 1
+- [ ] 0
+
+
+---
+## Break and Continue Statements
+
+### Break Statement
+**Note:** Only for loops
+If you want to break out of the loop if a certain condition is met then you use `break`. It will break the entire loop and execute the next statement.
+
+**Definition** Whenever a break is executed inside a loop, it terminates the loop.
+
+What will be the output of the following code?
+```python
+count = 1
+while count <= 100:
+ if count == 4:
+ break
+ print(count, end=" ")
+ count += 1
+```
+**Output**
+```plaintext
+1 2 3
+```
+
+
+
+### Continue Statement
+**Note:** Only for loops
+**Definition** It skips the inside loop and continues the loop's execution.
+
+```python
+count = 1
+while count <= 10:
+ count += 1
+ if count == 4:
+ continue
+ print(count, end=" ")
+
+```
+
+**Output**
+
+```plaintext
+1 2 3 5 6 7 8 9 10 11
+```
+* The continue statement simply skips the rest of the instructions of the current interaction and begins with the next iteration.
+
+Look at the example below:
+```python
+count = 1
+while count <= 10:
+ if count == 4:
+ continue
+ print(count, end=" ")
+ count += 1
+
+```
+* This will end up in an infinite loop. As the updation condition is never performed due to continue statment. So once it reaches 4, it keeps looping on 4.
+
+
+
+---
+## While-else
+* Only and only in Python
+* Else block will run only after the loop successfully terminates without a break.
+```python
+count = 1
+while count <= 100:
+ if count == 4:
+ break
+ print(count, end=" ")
+ count += 1
+else:
+ print("Yayy!")
+
+```
+* It will not print `Yayy!` as it is terminated via a `break` statement rather than terminating naturally.
+
+
+---
+## Check whether a number is prime or not
+
+### Example - Check Whether a Number is Prime or Not
+* Prime number is only divisible by `1` or the number itself.
+* One is neither prime not consonant.
+* We can say that `a` is divisible by `n` if `a % n == 0`.
+* We can say that `24` is not prime as `24` divides `2, 4, 6, 8, etc.`
+* We can say that `23` is a prime number cause it only divides `1` and `23`.
+* Write a code to check if the number is prime or not. Start a loop from `2` to `n-1` if it is dividing any number then return `not prime` else `prime`. We are not required to use `break`, `continue`, or `while else`.
+
+**Solution 1:**
+
+Let us say our number is `25`.
+We will use a variable `flag` to store whether a number is prime or not. It is simply a boolean variable initialized with `false`.
+
+As soon as the number is divisible by some other number we can change its value to `true` and it is not prime. If the number is not divisible by any other number the `flag` remains `false` and we can conclude that it is a prime number.
+
+```python
+n = int(input())
+count = 2
+flag = False
+while count < n:
+ if n % count == 0:
+ flag = True
+ count += 1
+if flag:
+ print("Not Prime")
+else:
+ print("Prime")
+
+```
+
+**Solution 2:**
+
+* Is not very different from the previous solution.
+* Now consider if the number is `9`, it is divisible by `3`. Do we need to check for other numbers? We don't! If the given number is divisible by any other number, we can break from the loop and declare that it is prime.
+* This is a great situation where we can use `break`.
+
+```python
+n = int(input())
+count = 2
+flag = False
+while count < n:
+ if n % count == 0:
+ flag = True
+ break
+ count += 1
+if flag:
+ print("Not Prime")
+else:
+ print("Prime")
+
+```
+
+**Solution 2:**
+
+* We can remove the flag. We can use the `while else` statement.
+* Instead of checking the flag, we can say that if we didn't break from the loop, it is a prime number.
+* So as soon as we encounter that the number is divisible by some other number we print it is not prime. In the else part we print it is prime.
+
+```python
+n = int(input())
+i = 2
+while i < n:
+ if n % i == 0:
+ print("not prime")
+ break
+ i += 1
+else:
+ print("prime number")
+
+```
+
+---
+### Question
+
+When can we say a number A is divisible by n?
+
+**Choices**
+
+- [x] A % n == 0
+- [ ] A / n == 0
+- [ ] A // n == 0
+- [ ] A % n != 0
+
+
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+count = 1
+while(count <= 5):
+ if(count == 2):
+ break
+ print(count, end = ' ')
+ count += 1
+```
+
+**Choices**
+
+- [ ] 1 3 4 5
+- [x] 1
+- [ ] 1 2
+- [ ] 0 1
+
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+count = 1
+while(count <= 5):
+ if(count == 3):
+ continue
+ print(count, end = ' ')
+ count += 1
+```
+
+**Choices**
+
+- [ ] 1 2 3 4 5
+- [ ] 1 2 4
+- [ ] 0 1 2 4 5
+- [x] Infinite Loop
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Iteration 2.md b/Academy DSA Typed Notes/Python Refresher/Refresher Iteration 2.md
new file mode 100644
index 0000000..6d3d144
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Iteration 2.md
@@ -0,0 +1,486 @@
+# Refresher: Iteration 2
+# Introduction
+
+---
+### Recap
+* introduction to loop
+* while, while else
+* break and continue
+* print 1 to n, n to 1
+* print even numbers, sum
+* prime numbers
+* scrapers and scissors
+
+
+---
+### Question
+
+What is the output of the following?
+
+```python
+count = 0
+while(count < 10):
+ print(10, end = ' ')
+ count += 1
+```
+
+
+**Choices**
+
+- [ ] 0 1 2 3 4 5 6 7 8 9
+- [x] 10 10 10 10 10 10 10 10 10 10
+- [ ] Infinite Loop
+
+
+---
+### Question
+
+Which is true for an Odd number n?
+
+**Choices**
+
+- [ ] n % 2 == 0
+- [x] n % 2 = = 1
+
+
+---
+### Question
+
+What operation can be used to get the last digit of a number?
+
+**Choices**
+
+- [ ] n - 10
+- [ ] n // 10
+- [ ] int(n / 10)
+- [x] n % 10
+
+---
+### Question
+
+What will be the output of the following?
+
+```python
+count = 1
+while(count <= 5):
+ if(count == 2):
+ break
+ print(count, end = ' ')
+ count += 1
+```
+
+**Choices**
+
+- [ ] 1 3 4 5
+- [x] 1
+- [ ] 1 2
+- [ ] 0 1
+
+---
+## Range Function
+1. `range(n)` returns number from 0 to n-1.
+* start = 0
+* jump = 1
+* number line example
+
+* range(-5) -> nothing as decrementing -5 we will never reach anywhere.
+* range(1) -> 0
+
+2. range(start, end) -> general numbers from [start, end-1]
+* jump -> +1
+* range(1,3) -> 1,2
+* range(-5, -1) -> -5, -4, -3, -2
+* range(-4, -10) -> nothing
+* range(5, 1) -> nothing
+
+
+3. range(start, end, jump)
+* start, end - 1
+* range(1,6,2) -> 1, 3, 5
+* range(0, -5, -1) -> 0, -1, -2, -3, -4
+
+
+### Precautions
+* jump can not be zero
+* range always takes and returns an integer value
+
+---
+## Iterables an Iterators
+* Assume that we have a bag of candies. I put my hand in the bag and take the candies out of the back one by one.
+
+* Examples - list, dict, set, string, range, enumerate, tuple
+* Iterables are groups of objects
+* Iterator can be related to the hand that we are using to take candies out of the iterables(bag of candies).
+
+### Range as an Iterable
+* Range is iterable, it is a collection of integers. If the range returns nothing we can say the bag is empty it doesn't return anything.
+
+`print(range(3))` What will this return?
+* Print is not an iterator it will simply return `range(3)`.
+* for loop is one of the best iterators.
+
+---
+## For Loop
+
+**Syntax:**
+
+```python
+for variable in iterable:
+ action
+```
+* With for loop we can skip initialization, condition, and updation.
+* It is an alternative to the `foreach` loop.
+* The for loop can be used with iterables such as lists, dictionaries, etc. This will be covered when we will discuss lists and other iterables.
+
+
+### Question - Print 1 to 100?
+```python
+ for i in range(1, 101):
+ print(i)
+```
+
+---
+### Question
+
+What will the sequence be generated by the following?
+
+```python
+range(5)
+```
+
+**Choices**
+
+- [ ] 1 2 3 4 5
+- [ ] 0 1 2 3 4 5
+- [ ] 1 2 3 4
+- [x] 0 1 2 3 4
+
+---
+### Question
+
+What will the sequence be generated by the following?
+
+```python
+range(5,15, 2)
+```
+**Choices**
+
+- [ ] 5,6,7,8,9,10,11,12,13,14,15
+- [ ] 5,7,9,11,13,15
+- [x] 5,7,9,11,13
+- [ ] 5,6,7,8,9,10,11,12,13,14
+
+---
+### Question
+
+What will the sequence be generated by the following?
+
+```python
+range(-5,0,1)
+```
+
+**Choices**
+
+- [ ] -5,-4,-3,-2,-1,0
+- [ ] Nothing
+- [ ] 0,-1,-2,-3,-4,-5
+- [x] -5,-4,-3,-2,-1
+
+---
+### Question
+What will the sequence be generated by the following?
+
+```python
+range(-10,-5,-1)
+```
+
+**Choices**
+
+- [ ] -10,-9,-8,-7,-6,-5
+- [ ] -10,-9,-8,-7,-6
+- [x] Nothing
+- [ ] -6,-7,-8,-9,-10
+
+---
+### Question
+What is the output of the following?
+
+```python
+for i in range(0,1):
+ print('Hello')
+```
+
+**Choices**
+
+- [ ] Hello
+Hello
+- [ ] Hello
+- [x] Nothing
+- [ ] 0
+1
+
+How many values will be returned by this:
+```python
+range(n) -> n
+```
+
+If you want the loop to run `n` times just say range(n). The loop will run `n` times but start with zero till `n-1` therefore `n` values.
+```python
+range(5) -> 0, 1, 2, 3, 4 => 5 values
+```
+
+---
+## Break and Continue in For Loop
+* Break and Continue is same as we saw in while loop.
+* If you want to break out of the loop if a certain condition is met then you use break. It will break the entire loop and execute the next statement.
+* It skips the inside loop and continues the loop’s execution.
+**[ASK THE LEARNERS]**
+is `_`(underscore) a valid variable name?
+* Variable should start with an alphabet or an `_`
+* can only have underscore, alphabets, and numbers.
+* It should not start with a number.
+* Many programmers use underscore when they don't need a name for a variable in the for loop.
+```python
+for _ in range(10):
+ print("hello")
+```
+* If we use `_` it won't give a warning in case we are not using it. With any other variable name, it will give a warning in Python.
+* What will be the output of the following:
+```python
+for i in range(10):
+ if(i == 4):
+ break
+ print(i)
+```
+**Output:**
+```plaintext
+0
+1
+2
+3
+```
+
+* What will be the output of the following:
+```python
+for i in range(6):
+ if(i % 2 == 0):
+ continue
+ print(i)
+```
+**Output:**
+```plaintext
+1
+3
+5
+```
+
+---
+## Pass Statement
+* It is not to be used in competitive programming or interviews. It is usually used in testing.
+* The `pass` does nothing. It signifies that the programmer will later add some code to it. Right now ignore this block.
+```python
+for i in range(6):
+ if(i % 2 == 0):
+ pass
+ print(i)
+```
+* Pass will still print the `i`. In case of continuing it will directly begin with a new iteration.
+
+---
+## For Else Loop
+* Else statement will execute if the loop terminates successfully i.e. without a break
+* Write a code for the prime number in the for loop.
+```python
+n = int(input())
+for i in range(2,n):
+ if(n % i == 0):
+ print("Not Prime")
+ break
+ else:
+ print("Prime")
+```
+
+---
+### Question
+What is the output of the following?
+
+```python
+for i in range(0,10):
+ if(i % 3 == 0):
+ continue
+ print(i, end = ' ')
+```
+
+**Choices**
+
+- [ ] 0 1 2 3 4 5 6 7 8 9
+- [ ] 0 1 2
+- [ ] 0 1 2 4 5 7 8 9
+- [x] 0 1 2 4 5 7 8
+
+
+
+---
+### Question
+What is the output of the following?
+
+```python
+for i in range(1,10):
+ if(i % 3 == 0):
+ break
+ print(i, end = ' ')
+```
+
+**Choices**
+
+- [ ] 1 2 3 4 5 6 7 8 9
+- [x] 1 2
+- [ ] 1 2 4 5 7 8 9
+- [ ] 1 2 4 5 6 7 8
+
+
+---
+## Nested Loops
+* If we write a loop inside a loop it is a nested loop.
+* Look at the pattern below and write a code to generate this pattern.
+```plaintext
+1 2 3 4 5
+1 2 3 4 5
+1 2 3 4 5
+1 2 3 4 5
+```
+
+If I want to print `1 to 5`, how will I write the code?
+```python
+for i in range(1,6):
+ print(1, end = " ")
+```
+Now if I want to do this 5 times will I do this?
+```python
+for i in range(1,6):
+ print(1, end = " ")
+print()
+for i in range(1,6):
+ print(1, end = " ")
+print()
+for i in range(1,6):
+ print(1, end = " ")
+print()
+for i in range(1,6):
+ print(1, end = " ")
+print()
+for i in range(1,6):
+ print(1, end = " ")
+print()
+```
+* No right? What principle it is not following?
+* DRY (Do not repeat yourself).
+* I will use a nested loop.
+```python
+for _ in range(5):
+ for i in range(1,6):
+ print(1, end = " ")
+ print()
+```
+
+* Single for loop gives 1D data, 2 loops nested will give 2D, and so on.
+* Similarly we can write nested while loop
+
+---
+## Difference b/w For and While Loop
+
+
+| For | While |
+| :------------------------------------------------------------------------------: | :--------------: |
+| It is simple to use. Initialization, condition, and updation in a single line. | Complex to use |
+| Only for simple iteration | Complex tasks such as scrapper and Scissors can be performed |
+
+**Note:** Never update the iteration variable in the for loop.
+
+---
+## Pattern Printing Problems
+
+```plaintext
+* * * * *
+* * * * *
+* * * * *
+* * * * *
+* * * * *
+```
+Write a code to print this pattern.
+
+:::warning
+Please take some time to think about the solution on your own before reading further.....
+:::
+
+**Solution 1**
+
+```python
+for i in range(5):
+ for j in range(5):
+ print("*", end = " ")
+ print()
+```
+**Solution 2**
+We are using string to integer multiplication. The statement `print("* "*5)` will generate a line with 5 stars and a space in between.
+
+```python
+for _ in range(5):
+ print("* " * 5)
+```
+
+### Staircase Binding
+```plaintext
+*
+* *
+* * *
+* * * *
+* * * * *
+```
+
+:::warning
+Please take some time to think about the solution on your own before reading further.....
+:::
+
+
+**Solution 1**
+When `i` is `1` we print `1` star, when `i` is `2` we print `2` star, and so on.
+
+```python
+n = int(input())
+for i in range(1, n + 1):
+ print("* " * i)
+```
+
+**Solution 2**
+
+We can do it with the nested loop as well
+```python
+for i in range(1, n + 1):
+ for j in range(i):
+ print("*", end = " ")
+ print()
+```
+
+### Reverse Staircase
+```python
+ *
+ * *
+ * * *
+ * * * *
+ * * * * *
+
+```
+* Can you guys do it or should I give you a hint?
+
+**No spaces between stars**
+* Assuming that there is no space between starts. What we are doing is `4 spaces 1 star`, `3 spaces 2 stars`, `2 spaces 3 stars` and so on.
+```python
+for i in range(1,6):
+ spaces = " " * (n - i)
+ stars = "*" * (i)
+ print(spaces + stars)
+```
+
+### Homework Problem
+
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher List 1.md b/Academy DSA Typed Notes/Python Refresher/Refresher List 1.md
new file mode 100644
index 0000000..2d5a6d7
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher List 1.md
@@ -0,0 +1,936 @@
+# Refresher: List 1
+
+## Defining a List
+
+### Definition
+
+A list is a built-in data type that represents an ordered collection of items. It is a mutable, dynamic array, meaning you can modify its elements and size after creation.
+
+### Syntax
+
+```python
+my_list = [element1, element2, element3, ...]
+```
+
+### Examples
+
+
+- The provided code snippets demonstrate various aspects of working with lists in Python.
+
+**Code 1**:
+
+```python
+a = [1, 2, 3]
+```
+
+- Initializes a list `a` with three integer elements.
+
+**Code 2**:
+
+```python
+a = [1, "a"]
+```
+
+- Initializes a list `a` with two elements: an integer `1` and a string `"a"`.
+
+**Output 2**:
+
+```plaintext
+# SyntaxError: closing parenthesis '}' does not match opening parenthesis '['
+a = [1, "a"]
+```
+
+- This part of the code seems incomplete and might be causing a syntax error. The specific error is related to unmatched parentheses.
+
+**Code 3**:
+
+```python
+a = ["a", 1, 3.14, True] # Lists can be heterogeneous
+```
+
+- Demonstrates that lists in Python can contain elements of different data types.
+
+**Code 4**:
+
+```python
+a = list(range(10))
+print(a)
+```
+
+**Output 4**:
+
+```plaintext
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+```
+
+- Uses the `list()` constructor to create a list containing elements from `0` to `9` (result of `range(10)`).
+
+**Code 5**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja']
+print(students)
+```
+
+**Output 5**:
+
+```plaintext
+['Kusum', 'Shubham', 'Pooja']
+```
+
+- Prints the list of student names.
+
+### Indexing in a List
+
+
+
+**Code**:
+
+```python
+print(students[1])
+```
+
+**Output**:
+
+```plaintext
+Shubham
+```
+
+**Code**:
+
+```python
+print(students[5])
+```
+
+**Output**:
+
+```plaintext
+# IndexError: list index out of range
+```
+
+**Explanation**:
+
+- Accessing elements in a list using indices.
+- An IndexError occurs when trying to access an index beyond the list's length.
+
+### Reverse Indexing
+
+
+
+**Code**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja']
+print(students[-1])
+```
+
+**Output**:
+
+```plaintext
+Pooja
+```
+
+**Code**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja']
+print(students[-100])
+```
+
+**Output**:
+
+```plaintext
+# IndexError: list index out of range
+```
+
+### Updating an Index in A List
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja']
+print(students)
+```
+
+**Output**:
+
+```python
+['Kusum', 'Shubham', 'Pooja']
+```
+
+- Updating user at index 3
+
+**Code**:
+
+```python
+students[3] = 'Ruben'
+print(students)
+```
+
+**Output**:
+
+```python
+['Kusum', 'Shubham', 'Pooja', 'Ruben']
+```
+
+**Code**:
+
+```python
+students[-100]
+```
+
+**Output**:
+
+```python
+# IndexError: list index out of range
+```
+
+**Code**:
+
+```python
+print(type(students))
+```
+
+**Output**:
+
+```python
+
+```
+
+- Print even numbers till 10
+
+**Code**:
+
+```python
+a = list(range(0, 11, 2))
+print(a)
+```
+
+**Output**:
+
+```python
+[0, 2, 4, 6, 8, 10]
+```
+
+- Print first 10 even numbers
+
+**Code**:
+
+```python
+a = list(range(0, 20, 2))
+print(a)
+```
+
+**Output**:
+
+```python
+[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
+```
+
+**Explanation**:
+
+- Lists can be modified by assigning new values to specific indices.
+- Negative indices count from the end of the list.
+
+### Iteration in a List
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth', 'Veerendra']
+```
+
+- `len()` gives you the number of elements in a list
+
+**Code**:
+
+```python
+print(len(students))
+```
+
+**Output**:
+
+```python
+7
+```
+
+**Code**:
+
+```python
+# Solution 1
+n = len(students)
+for i in range(0, n):
+ print(students[i])
+```
+
+**Output**:
+
+```python
+Kusum
+Shubham
+Pooja
+Ruben
+Aarushi
+Vinoth
+Veerendra
+```
+
+**Code**:
+
+```python
+# Solution 2
+for student in students:
+ print(student)
+```
+
+**Output**:
+
+```python
+Kusum
+Shubham
+Pooja
+Ruben
+Aarushi
+Vinoth
+Veerendra
+```
+
+### Quiz 1
+
+**Code**:
+
+```python
+# quiz
+li = [-1, 0, 4]
+for i in li:
+ if i > 0:
+ print(i, end=' ')
+```
+
+**Output**:
+
+```python
+4
+```
+
+**Explanation**:
+
+- Iterating through a list and printing positive numbers.
+
+### Functions in a List
+
+### len()
+
+- Returns the number of elements in a list.
+
+**Code**:
+
+```python
+a = list(range(2, 6))
+print(len(a))
+```
+
+**Output**:
+
+```plaintext
+4
+```
+
+### append()
+
+- Appends an object to the end of the list.
+
+**Code**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth', 'Veerendra']
+students.append('Vicky')
+print(students)
+```
+
+**Output**:
+
+```plaintext
+['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth', 'Veerendra', 'Vicky']
+```
+
+**Code**:
+
+```python
+a = []
+a.append('Hi')
+print(a)
+```
+
+**Output**:
+
+```plaintext
+['Hi']
+```
+
+### insert()
+
+
+- The `insert` method is used to insert an element before the specified index in a list.
+
+**Code**:
+
+```python
+a = [1, 2, 3, 4]
+a.insert(1, 'Aakar')
+print(a)
+```
+
+**Output**:
+
+```plaintext
+[1, 'Aakar', 2, 3, 4]
+```
+
+**Explanation**:
+
+- The element 'Aakar' is inserted at index 1, shifting the original elements to the right.
+
+**Code**:
+
+```python
+a = [1, 2, 3, 4]
+a.insert(-3, 'Aakar')
+print(a)
+```
+
+**Output**:
+
+```plaintext
+[1, 'Aakar', 2, 3, 4]
+```
+
+**Explanation**:
+
+- The negative index `-3` is interpreted as counting from the end of the list, so 'Aakar' is inserted at index 2 from the end.
+
+**Code**:
+
+```python
+a = [1, 2, 3, 4]
+a.insert(100, 'Aakar')
+print(a)
+```
+
+**Output 3**:
+
+```plaintext
+[1, 2, 3, 4, 'Aakar']
+```
+
+**Explanation**:
+
+- If the specified index is greater than the length of the list, the element is inserted at the end.
+
+**Code**:
+
+```python
+a = [1, 2, 3, 4]
+a.insert(-100, 'Aakar')
+print(a)
+```
+
+**Output**:
+
+```plaintext
+['Aakar', 1, 2, 3, 4]
+```
+
+**Explanation**:
+
+- The negative index `-100` is interpreted as counting from the end of the list, so 'Aakar' is inserted at the beginning of the list.
+
+### pop()
+
+- Removes and returns an item at the specified index (default last).
+- Raises `IndexError` if the list is empty or the index is out of range.
+
+**Code**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth', 'Veerendra']
+print(students.pop())
+print(students)
+```
+
+**Output**:
+
+```plaintext
+Veerendra
+['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth']
+```
+
+**Code**:
+
+```python
+a = [1, 2, 3, 4]
+print(a.pop(5))
+print(a)
+```
+
+**Output**:
+
+```plaintext
+# IndexError: pop index out of range
+```
+
+**Code**:
+
+```python
+a = []
+print(a.pop())
+print(a)
+```
+
+**Output**:
+
+```plaintext
+# IndexError: pop from an empty list
+```
+
+**Explanation**:
+
+- The `pop()` function removes and returns an item at a specified index.
+- Raises an `IndexError` if the index is out of range.
+
+### remove()
+
+- Removes the first occurrence of a value.
+- Raises `ValueError` if the value is not present.
+
+**Code**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth', 'Veerendra']
+students.remove('Shubham')
+print(students)
+```
+
+**Output**:
+
+```plaintext
+['Kusum', 'Pooja', 'Ruben', 'Aarushi', 'Vinoth', 'Veerendra']
+```
+
+**Code**:
+
+```python
+a = [1, 2, 3, 2, 4]
+a.remove(2)
+print(a)
+```
+
+**Output**:
+
+```plaintext
+[1, 3, 2, 4]
+```
+
+**Code**:
+
+```python
+a = [1, 2, 3, 4]
+a.remove(5)
+print(a)
+```
+
+**Output**:
+
+```plaintext
+# ValueError: list.remove(x): x not in the list
+```
+
+**Explanation**:
+
+- The `remove()` function removes the first occurrence of a specified value.
+- Raises a `ValueError` if the value is not present.
+
+### Quiz
+
+### Quiz 1
+
+```python
+li = [1, 2, 3]
+li.append('4')
+print(li)
+```
+
+**Answer**: [1, 2, 3, '4']
+
+### Quiz 2
+
+```python
+li = []
+print(len(li))
+```
+
+**Answer**: 0
+
+### Quiz 3
+
+```python
+li = [1, 2]
+print(li.pop())
+```
+
+**Answer**: 2
+
+### Quiz 4
+
+```python
+li = [1, 3, 4]
+li.insert(0, 2)
+print(li)
+```
+
+**Answer**: [2, 1, 3, 4]
+
+### Quiz 5
+
+```python
+li = [1, 2]
+print(li.remove(2))
+```
+
+**Answer**: None
+
+## Reverse
+
+**Code**:
+
+```python
+a = [1, 2, 3]
+print(a.reverse())
+print(a)
+```
+
+**Output**:
+
+```plaintext
+[3, 2, 1]
+```
+
+**Code**:
+
+```python
+a = []
+print(a.reverse())
+print(a)
+```
+
+**Output**:
+
+```plaintext
+None
+[]
+```
+
+**Explanation**:
+
+- The `reverse()` method reverses the elements of a list in place.
+
+## + operator
+
+- Concatenating two lists.
+- Creates a new list.
+
+**Code**:
+
+```python
+a = [1, 2, 3]
+b = [4, 5, 6]
+c = a + b
+print(c)
+print(a)
+print(b)
+```
+
+**Output**:
+
+```plaintext
+[1, 2, 3, 4, 5, 6]
+[1, 2, 3]
+[4, 5, 6]
+```
+
+### extend()
+
+
+- Extend list by appending elements from the iterable.
+
+**Code**:
+
+```python
+a = [1,2,3]
+b = [4,5,6]
+a.append(b)
+print(a)
+print(a[-1]) # not what we want
+```
+
+**Output**:
+
+```plaintext
+[1, 2, 3, [4, 5, 6]]
+[4, 5, 6]
+```
+
+**Explanation**:
+
+- The append() method is used, but it appends the entire list b as a single element at the end of list a.
+
+**Code**:
+
+```python
+a = [1,2,3]
+b = [4,5,6]
+a.extend(b)
+print(a)
+print(b)
+print(a[-1]) # not what we want
+```
+
+**Output**:
+
+```plaintext
+[1, 2, 3, 4, 5, 6]
+[4, 5, 6]
+6
+```
+
+**Explanation**:
+
+- The extend() method is used, adding each element from list b individually to the end of list a.
+
+**Code**:
+
+```python
+a = [1,2,3]
+a.extend(a)
+print(a)
+```
+
+**Output**:
+
+```plaintext
+[1, 2, 3, 1, 2, 3]
+```
+
+
+**Explanation**:
+
+- The extend() method is used to add elements of list a to the end of list a, effectively doubling its content.
+
+## in Operator
+
+- return True or False after searching list
+
+
+**Code**:
+
+```python
+students = ['Kusum', 'Shubham', 'Pooja', 'Ruben', 'Aarushi', 'Aakar', 'Veerendra']
+print('Aakar' in students)
+print('Kusum' in students)
+```
+
+**Output**:
+
+```plaintext
+False
+True
+```
+
+
+**Explanation**:
+
+- The `in` operator is used to check if an element is present in a list.
+- The first print statement checks if 'Aakar' is in the list of students, resulting in `False`.
+- The second print statement checks if 'Kusum' is in the list of students, resulting in `True`.
+
+### How to take List as Input?
+
+**Code**:
+
+```python
+n = int(input())
+a = []
+for i in range(n):
+ item = input()
+ a.append(item)
+print(a)
+```
+
+**Output**:
+
+```plaintext
+5
+a
+b
+c
+d
+e
+['a', 'b', 'c', 'd', 'e']
+```
+
+**Explanation**:
+
+- The code takes an integer `n` as input, then uses a loop to take `n` input items and appends them to a list `a`, resulting in a list of items.
+
+## Split
+
+**Code**:
+
+```python
+s = 'I-love-bananas'
+li = s.split('-')
+print(li)
+print(type(li))
+```
+
+**Output**:
+
+```plaintext
+['I', 'love', 'bananas']
+
+```
+**Explanation**:
+- The `split` method is used to split a string `s` into a list of substrings based on the specified delimiter ('-'), creating a list `li`.
+
+**Code**:
+
+```python
+s = 'I--love--bananas'
+li = s.split('--')
+print(li)
+print(type(li))
+```
+
+**Output**:
+
+```plaintext
+['I', 'love', 'bananas']
+
+```
+
+**Explanation**:
+- Even if there are multiple consecutive delimiters, `split` correctly handles them and produces the desired list.
+
+**Code**:
+
+```python
+n = int(input())
+s = input() # always returns string "a b c d e"
+li = s.split(' ')
+print(li)
+```
+
+**Output**:
+
+```plaintext
+5
+a b c d e
+['a', 'b', 'c', 'd', 'e']
+```
+
+**Explanation**:
+- The code takes an integer `n` and a space-separated string as input, then uses `split` to create a list `li` of individual items.
+
+**Code**:
+
+```python
+# INPUT
+# 5
+# 12 14 15 16 17
+n = int(input())
+s = input() # always returns string "a b c d e"
+li = s.split(' ')
+new_li = []
+for item in li:
+ new_li.append(int(item))
+print(new_li)
+```
+
+**Output**:
+
+```plaintext
+5
+1 2 3 4 5
+[1, 2, 3, 4, 5]
+```
+**Explanation**:
+
+- The code converts a space-separated string of numbers into a list of integers, demonstrating the use of `split` and conversion to integers.
+
+**Code**:
+
+```python
+# INPUT
+# 5
+# 12 14 15 16 17
+n = int(input())
+s = input() # always returns string "a b c d e"
+li = s.split(' ')
+for index in range(len(li)):
+ li[index] = int(li[index])
+print(li)
+```
+
+**Output**:
+
+```plaintext
+5
+1 2 3 4 5
+[1, 2, 3, 4, 5]
+```
+**Explanation**:
+- Similar to the previous example, this code converts a space-separated string of numbers into a list of integers using a loop.**Explanation**:
+
+
+### Problem
+
+Given a List of Student Marks, Count the Number of Student Who Failed
+
+:::info
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+**Code**:
+
+```python
+n = int(input())
+s = input() # always returns string "a b c d e"
+marks = s.split(' ')
+for index in range(len(marks)):
+ marks[index] = float(marks[index])
+print(marks)
+# ------------------------
+count = 0
+for index in range(len(marks)):
+ if marks[index] <= 30:
+ count += 1
+print(count)
+```
+
+**Output**:
+
+```plaintext
+5
+10 20 30 40 50
+[10.0, 20.0, 30.0, 40.0, 50.0]
+3
+```
+
+**Explanation**:
+
+- The code first takes an integer `n` as input, representing the number of students. Then, it takes a string `s` as input, which contains space-separated marks of students in the form of "a b c d e".
+- The string of marks is split into a list of strings using the `split` method, and then each element in the list is converted to a floating-point number using a loop.
+- The list of marks is printed as output.
+- The code initializes a variable `count` to 0 and then iterates through the list of marks. For each mark, if it is less than or equal to 30, the `count` is incremented.
+- Finally, the count of students who failed (marks <= 30) is printed as output.
+
+**Output Explanation**:
+
+- For the given input "5" and "10 20 30 40 50", the list of marks after conversion to float is `[10.0, 20.0, 30.0, 40.0, 50.0]`.
+- Among these marks, three students have marks less than or equal to 30 (10.0, 20.0, and 30.0). Therefore, the count of students who failed is printed as `3`.
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher List 2.md b/Academy DSA Typed Notes/Python Refresher/Refresher List 2.md
new file mode 100644
index 0000000..0377e94
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher List 2.md
@@ -0,0 +1,284 @@
+# Refresher: List 2
+
+## Builtin Functions
+
+### Index
+
+- Given a value and a list, find the element and print "Found" else "Not found"
+
+**Code**:
+
+```python
+# Solution 1
+li = list(map(int, input().split(' ')))
+value = int(input())
+for index in range(len(li)):
+ if li[index] == value:
+ print('Found at', index)
+ break
+else:
+ print('Not found')
+```
+
+**Output**:
+
+```plaintext
+1 2 3 4 5 6
+3
+Found at 2
+```
+
+- Displaying index
+
+**Code**:
+
+```python
+# Solution 2
+li = list(map(int, input().split(' ')))
+value = int(input())
+if value in li:
+ print('Found at', li.index(value))
+else:
+ print('Not found')
+```
+
+**Output**:
+
+```plaintext
+1 2 3 4 5 6
+3
+Found at 2
+```
+
+**Explaination**:
+
+- Solution 1 uses a for loop to iterate through the list and check if each element is equal to the given value. If found, it prints the index and breaks out of the loop. If not found, it prints "Not found."
+- Solution 2 uses the `in` operator to check if the value is present in the list. If found, it prints the index using the `index()` function. If not found, it prints "Not found."
+
+### max
+
+- Given a list, you have to find the maximum element in this list.
+
+**Code**:
+
+```python
+li = [-13, -53, -23, -21, -55]
+max_value = li[0]
+for item in li:
+ if max_value < item:
+ max_value = item
+print(max_value)
+```
+
+**Output**:
+
+```plaintext
+-13
+```
+
+**Code**:
+
+```python
+li = [-13, -53, -23, -21, -55]
+max_value = None
+for item in li:
+ if max_value is None or max_value < item:
+ max_value = item
+print(max_value)
+```
+
+**Output**:
+
+```plaintext
+-13
+```
+
+**Explaination**:
+
+- The first solution initializes `max_value` with the first element of the list and iterates through the list, updating `max_value` if a larger element is found.
+- The second solution initializes `max_value` to `None` and iterates through the list, updating `max_value` if a larger element is found. The `is None` check is used to handle an empty list case.
+
+### Printing max Value
+
+**Code**:
+
+```python
+li = [-13, -53, -23, -21, -55]
+print(max(li))
+
+print(max(1, 2, 3, 4, 5, 3, 4, 5, 1))
+```
+
+**Output**:
+
+```plaintext
+-13
+5
+```
+
+**Explaination**:
+
+- The `max()` function is used to directly find the maximum value in the list or a set of values.
+
+### Printing min Value
+
+
+**Code**:
+
+```python
+li = [-13, -53, -23, -21, -55]
+print(min(li))
+
+print(min(1, 2, 3, 4, 5, 3, 4, 5, 1))
+```
+
+**Output**:
+
+```plaintext
+-55
+1
+```
+
+**Explaination**:
+
+- The `min()` function is used to directly find the minimum value in the list or a set of values.
+
+### Slicing
+
+In this section, we will learn how to slice the list `[49, 6, 71]` from the given list
+
+**Code**:
+
+```python
+li = [2, 23, 49, 6, 71, 55]
+
+def sub_list(li, startIndex, endIndex):
+ new_li = []
+ for i in range(startIndex, endIndex + 1):
+ new_li.append(li[i])
+ return new_li
+
+print(sub_list(li, 2, 4))
+```
+
+**Output**:
+
+```plaintext
+[49, 6, 71]
+```
+
+**Explaination**:
+
+- The `sub_list` function takes a list and two indices as input and returns a new list containing elements from the start index to the end index.
+
+### More slicing examples
+
+
+#### li[:end]
+**Code**:
+```python
+a = list(range(10))
+print(a)
+print(a[::-2])
+```
+**Output**:
+```plaintext
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+[9, 7, 5, 3, 1]
+```
+**Explanation**:
+- `a[::-2]` creates a new list by slicing `a` with a step of -2, starting from the end.
+- It includes every second element in reverse order, resulting in `[9, 7, 5, 3, 1]`.
+
+#### li[start:end]
+**Code**:
+```python
+a = [5, 2, 3, 9, 8]
+print(a[1:5])
+```
+**Output**:
+```plaintext
+[2, 3, 9, 8]
+```
+**Explanation**:
+- The slice `a[1:5]` extracts elements starting from index 1 up to (but not including) index 5 from list `a`.
+
+#### li[start:]
+**Code**:
+```python
+a = [5, 2, 3, 9, 8]
+print(a[2:])
+```
+**Output**:
+```python!
+[3, 9, 8]
+```
+**Explanation**:
+- The slice `a[2:]` extracts elements starting from index 2 till the end of the list `a`.
+
+#### li[start\:end:range]
+**Code**:
+```python
+a = [5, 2, 3, 9, 8]
+print(a[1:4:2])
+```
+**Output**:
+```python
+[2, 9]
+```
+**Explanation**:
+- The slice `a[1:4:2]` extracts elements starting from index 1 up to (but not including) index 4 with a step of 2.
+- It includes every second element in the specified range, resulting in `[2, 9]`.
+
+
+---
+## Problem Solving
+
+### Question
+
+Right shift the given array:
+
+**li = [2,3,4,5,6]
+n = [0,n - 1]
+Output = [3,4,5,6,2]**
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+### Solution 1
+
+**Code**:
+
+```python
+li = [2,3,4,5,6]
+n = int(input())
+for i in range(n):
+ a = li.pop(0)
+ li.append(a)
+print(li)
+```
+
+**Output**:
+
+```python
+3
+[5, 6, 2, 3, 4]
+```
+
+## Solution 2
+
+**Code**:
+
+```python
+li = [2,3,4,5,6]
+n = int(input())
+print(li[n:] + li[:n])
+```
+
+**Output**:
+
+```python
+3
+[5, 6, 2, 3, 4]
+```
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher List 3.md b/Academy DSA Typed Notes/Python Refresher/Refresher List 3.md
new file mode 100644
index 0000000..86f7017
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher List 3.md
@@ -0,0 +1,222 @@
+# Refresher: List 3
+
+## Nested List
+
+### Introduction
+
+- A nested list in Python is a list that can contain other lists as elements.
+- It allows you to create a two-dimensional structure, also known as a 2D list, where each element in the outer list can be a list itself.
+
+**Code**:
+
+```python
+maths = [1, 1, 1]
+science = [2, 2, 2]
+history = [3, 3, 3]
+subjects = [maths, science, history]
+print(subjects)
+```
+
+**Output**:
+
+```python
+[[1, 1, 1], [2, 2, 2], [3, 3, 3]]
+```
+
+**Explanation of code**:
+
+- Three separate lists, `maths`, `science`, and `history`, are created.
+- These lists are then combined into a single list named `subjects`.
+- The `print(subjects)` statement displays the resulting nested list.
+
+---
+## Indexing in a 2D List
+
+- Indexing in a 2D list involves accessing elements using two indices: one for the outer list (row) and another for the inner list (column).
+
+**Code**:
+
+```python
+print(subjects[0][2])
+
+# row major form
+print(subjects)
+```
+
+**Output**:
+
+```python
+1
+[[1, 1, 1], [2, 2, 2], [3, 3, 3]]
+```
+
+**Explanation of code**:
+
+- The expression `subjects[0][2]` accesses the element in the first row (index 0) and the third column (index 2) of the 2D list.
+- The second `print(subjects)` statement displays the entire 2D list.
+
+---
+## Iterating a 2D List
+
+### Example 1
+
+**Code**:
+
+```python
+for row_index in range(len(subjects)):
+ for col_index in range(len(subjects[row_index])):
+ print(subjects[row_index][col_index], end = ' ')
+```
+
+**Output**:
+
+```python
+1 1 1 2 2 2 3 3 3
+```
+
+**Explanation of code**:
+
+- Nested loops iterate through each element of the 2D list, printing them horizontally.
+
+### Example 2
+
+**Code**:
+
+```python
+for row_index in range(len(subjects)):
+ for col_index in range(len(subjects[row_index])):
+ print(subjects[row_index][col_index], end=' ')
+ print()
+```
+
+**Output**:
+
+```python
+1 1 1
+2 2 2
+3 3 3
+```
+
+**Explanation of code**:
+
+- Similar to Example 1, but with an additional `print()` to create a new line after each row.
+
+### Example 3
+
+**Code**:
+
+```python
+for col_index in range(len(subjects[0])):
+ for row_index in range(len(subjects)):
+ print(subjects[row_index][col_index], end = ' ')
+ print()
+```
+
+**Output**:
+
+```python
+1 2 3
+1 2 3
+1 2 3
+```
+
+**Explanation of code**:
+
+- This example transposes the 2D list by iterating through columns first and then rows.
+
+---
+
+### Input in a 2D List
+
+### Example
+
+**Code**:
+
+```python
+def take_list_as_input():
+ li = list(map(int, input().split()))
+ return li
+
+a = []
+for i in range(3):
+ a.append(take_list_as_input())
+print(a)
+```
+
+**Output**:
+
+```python
+12 13 14
+45 46 47
+34 35 36
+[[12, 13, 14], [45, 46, 47], [34, 35, 36]]
+```
+
+**Explanation of code**:
+
+- The `take_list_as_input()` function reads a line of space-separated integers and converts them into a list.
+- The loop collects three such lists to create a 2D list named `a`.
+
+### Row Wise Sum
+
+**Code**:
+
+```python
+def take_list_as_input():
+ li = list(map(int, input().split()))
+ return li
+
+a = []
+for i in range(3):
+ a.append(take_list_as_input())
+print(a)
+
+for row_index in range(len(a)):
+ row_sum = sum(a[row_index])
+ print(row_sum)
+```
+
+**Output**:
+
+```python
+1 1 1
+2 2 2
+3 3 3
+[[1, 1, 1], [2, 2, 2], [3, 3, 3]]
+3
+6
+9
+```
+
+**Explanation of code**:
+
+- Calculates and prints the sum of each row in the 2D list.
+
+
+---
+## Matrix Addition
+
+**Code**:
+
+```python
+a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
+b = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
+c = []
+
+for row_index in range(len(a)):
+ temp = []
+ for col_index in range(len(a[row_index])):
+ temp.append(a[row_index][col_index] + b[row_index][col_index])
+ c.append(temp)
+print(c)
+```
+
+**Output**:
+
+```python
+[[2, 4, 6], [8, 10, 12], [14, 16, 18]]
+```
+
+**Explanation of code**:
+
+- Performs matrix addition on two 2D lists (`a` and `b`) and stores the result in the list `c`.
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Operators and Control Statements.md b/Academy DSA Typed Notes/Python Refresher/Refresher Operators and Control Statements.md
new file mode 100644
index 0000000..7a662db
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Operators and Control Statements.md
@@ -0,0 +1,1592 @@
+# Refresher: Operators and Control Statements
+
+### Question
+
+What is the output of the following?
+`print(type("1"))`
+
+**Choices**
+
+- [ ] int
+- [ ] float
+- [x] str
+- [ ] bool
+
+
+
+---
+### Question
+
+What is the output of the following?
+`print(bool("0"))`
+
+**Choices**
+
+- [x] True
+- [ ] False
+- [ ] Error
+
+**Explanation**
+
+`print(bool("0"))`
+
+**Rules for converting string to bool are:**
+- Empty string will be converted to False.
+- Everything else will be converted to True.
+
+Here we have a string "0", so it has some value, it is not empty, so it will be True.
+
+
+
+
+---
+### Question
+
+```python
+print("Rahul", "Rohit", "Emma Watson", sep = " ")
+print("Yash KGF")
+```
+
+**Choices**
+
+- [x] Rahul Rohit Emma Watson
+ Yash KGF
+- [ ] Rahul Rohit Emma Watson Yash KGF
+- [ ] Not Sure
+
+**Explanation**
+
+```python
+print("Rahul", "Rohit", "Emma Watson", sep = " ")
+print("Yash KGF")
+```
+
+We have specified `sep` as `" "`, and by default `end` will be a new line, so Yash KGF will be printed in a new line.
+
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+b = input() # input value = 234
+print(type(b))
+```
+
+**Choices**
+
+- [ ] int
+- [x] string
+- [ ] not sure
+
+
+### Operators
+
+Before operators, we just understand what is expression,
+**Expression:** is just a simple equation we write.
+
+**Example of expression:**
+`a = b + c`
+
+Here,
+- `a`, `b` and `c` are variables, or we can also call these operands.
+- `=` and `+` are operators.
+
+So, if we want to do certain operations then we need operators.
+
+Operators are classified into different types based on their functionalities:
+1. Arithmetic Operators.
+2. Comparison Operators.
+3. Assignment Operators.
+4. Logical Operators.
+
+
+
+### Arithmetic Operators
+Arithmetic Operators are used for arithmetic calculations.
+Different arithmetic operators are explained below:
+
+### Addition
+`+` is used for addition, it can not work at one value, it always takes two values.
+
+
+
+**Example:**
+```python
+a = 1
+b = 4
+print(a + b)
+```
+
+**Output:**
+```plaintext
+5
+```
+
+**Type change in addition:**
+- **int + int -> int** We can add an integer and integer value to get an int value.
+- **float + float -> float**, we can add float and float value to get float value.
+* **int + float -> float**, we can add integer and float value to get float value
+* **int/float + bool -> int/float,** we can add int/float and bool value and it will give int/float value as a result.
+
+**Example:**
+```python
+print(2.5 + True)
+```
+
+**Output:**
+```plaintext
+3.5
+```
+
+Here True will be converted to float value i.e. 1.0, and then it will be added to 2.5 which will give 3.5 as a result.
+
+
+**Example:**
+```python
+print(2.5 + False)
+```
+
+**Output:**
+```plaintext
+2.5
+```
+
+Here False will be converted to float value i.e. 0.0, and it will be added to 2.5 which will give 2.5 as a result.
+
+
+
+* **string + string -> string** (concatenation)
+
+
+**Example:**
+```python
+print('1' + '1')
+```
+
+**Output:**
+```plaintext
+11
+```
+
+**Not allowed in Python:**
+* **int/float/bool + string**, Python does not allow to add int/float/bool to string, it will give an error.
+
+**Example:**
+```python
+print('1' + 1)
+```
+
+**Output:**
+```plaintext
+TypeError Traceback (most recent call last)
+Cell In[20], line 1
+----> 1 print('1' + 1)
+TypeError: can only concatenate str (not "int") to str
+```
+
+
+* **int/float/bool/string + None,** we can not do any arithmetic operations wth none.
+
+
+**Example:**
+```python
+print(1 + None)
+```
+
+**Output:**
+```plaintext
+TypeError Traceback (most recent call last)
+Cell In[24], line 1
+----> 1 print(1 + None)
+TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
+```
+
+
+### Subtraction
+`-` is used for Subtraction.
+
+It can be directly used with constants.
+**Example:**
+```python
+print(2 - 3)
+```
+
+**Output:**
+```plaintext
+-1
+```
+
+We can also perform subtraction on variables.
+
+**Example:**
+```python
+a = 1
+a_b = 2
+print(a - a_b)
+```
+
+**Output:**
+```plaintext
+-1
+```
+
+**Type change in subtraction**
+* **int - int -> int**
+* **float - float -> float**
+* **int - float -> float**
+* **int/float - bool -> int/float**
+
+**Example:**
+```python
+print(2.5 - True)
+```
+
+**Output:**
+```plaintext
+1.5
+```
+
+True will be converted into `1.0`, and then it will subtracted.
+
+**Example:**
+```python
+print(2.5 - False)
+```
+
+**Output:**
+```plaintext
+2.5
+```
+
+False will be converted into `0.0`, then it will subtracted.
+
+**Not allowed**
+* **string - string,** in string subtraction is not allowed, we can add strings.
+* **int/float/bool - string**
+* **int/float/bool/string - None**
+
+
+
+### Multiplication
+`*` is used for Multiplication.
+
+**Example:**
+```python
+print(2 * 3)
+```
+
+**Output:**
+```plaintext
+6
+```
+
+
+**Type change in multiplication**
+* **int * int -> int**
+* **float * float -> float**
+* **int * float -> float**
+* **int/float * bool -> int/float,** if multiplied by False, then we will always get 0 or 0.0, or if multiplied with True, then it will be the same number.
+* **int * string -> string (duplication),** we can multiply an integer with a string, it will duplicate the string to the number of times of integer value.
+
+
+
+**Example:**
+```python
+print('I am Sorry \n' * 10)
+```
+
+**Output:**
+```plaintext
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+I am Sorry
+```
+
+
+
+**Not allowed**
+* **string * string**
+* **float * string**
+* **int/float/bool/string * None**
+
+
+
+### Division
+`/` is used for Division.
+
+
+
+**Example:**
+```python
+print(3 / 2)
+```
+
+**Output:**
+```plaintext
+1.5
+```
+
+
+**Type change in division**
+
+
+* **int / int -> float**
+**Example:**
+```python
+print(2 / 2)
+```
+
+**Output:**
+```plaintext=
+1.0
+```
+* **float / float -> float**
+* **int / float -> float**
+
+
+**Not allowed**
+
+* **string/string**
+* **float/string**
+* **int/float/bool/string / None**
+
+**Example:**
+```python
+print(-3 / 2)
+```
+
+**Output:**
+```plaintext
+-1.5
+```
+
+
+
+### Modulus (mod) - Remainder
+`%` is a Modulus (mod) operator symbol, it calculates the remainder.
+
+
+
+
+**Example:**
+```python
+print(5 % 2)
+```
+
+**Output:**
+```plaintext
+1
+```
+
+
+**Example:**
+```python
+print(8 % 3)
+```
+
+**Output:**
+```plaintext
+2
+```
+
+**Type change in modulus**
+- int % int -> int
+
+
+### Floor Division
+`//` is the floor division operator, it first divides the number, and it gives the previous smaller integer value of the quotient as a result.
+
+
+
+**Example:**
+```python
+print(8 // 3)
+```
+
+**Output:**
+```plaintext
+2
+```
+
+
+**floor:**
+`floor(-2.5) = -3`
+as a previous smaller integer of -2.5 is -3,
+
+
+
+`floor(3.25) = 3`
+as a previous smaller integer of 3.25 is 3.
+
+
+
+
+**Example:**
+```python
+import math
+print(math.floor(-2.5))
+print(int(-2.5))
+print(math.floor(3.00001))
+```
+
+**Output:**
+```plaintext
+-3
+-2
+3
+```
+
+
+**Type change in floor division**
+- **int/float // int/float -> integral part**, floor division gives integer for float values division also, it always give integral floor value of float quotient.
+
+
+Integer typecasting simply removes the number available after the decimal point, but floor division gives the previous smaller integer value of the quotient.
+
+### Power
+`**` works as a power operator in Python.
+
+
+
+**Example:**
+```python
+print(2 ** 3)
+```
+
+**Output:**
+```plaintext
+8
+```
+
+It can have float values also.
+
+
+**Example:**
+```python
+print(2 ** 0.5)
+```
+
+**Output:**
+```plaintext
+1.4142135623730951
+```
+
+The above code gives us a square root of 2.
+
+**Type change in floor division**
+- **int/float ** int/float -> int/float**
+
+
+
+**Example:**
+```python
+print(3.5 ** 2)
+```
+
+**Output:**
+```plaintext
+12.25
+```
+
+
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+print(10 % 3)
+```
+
+**Choices**
+
+- [ ] 0
+- [x] 1
+- [ ] 2
+- [ ] 3
+
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+print(2 ** 3)
+```
+
+**Choices**
+
+- [ ] 5
+- [ ] 6
+- [ ] 7
+- [x] 8
+
+
+
+---
+### Question
+
+What is `floor(2.0)`?
+**Choices**
+
+- [x] 2
+- [ ] 1
+- [ ] 3
+
+
+
+
+
+---
+### Question
+`print(-8 // 3)`
+
+**Choices**
+
+- [ ] -2.666
+- [ ] -2
+- [x] -3
+
+
+**Explanation**
+
+```python
+print(-8 // 3)
+```
+
+
+As -8/3 = -2.6666666666666665, if we calculate its floor then it will be -3, as the previous integer value of -2.6666666666666665 is **-3**.
+
+
+---
+## Comparison Operator
+
+### Comparison Operator
+Comparison Operator is used for comparison, when we want to compare the value of two things, we can compare in the following ways.
+* Equal
+* Not Equal
+* Less than / Greater than
+* Less than and equal / Greater than and equal
+
+**Comparison Operator always returns bool,** it always tells us True or False.
+
+
+### Equal
+`==` is equal operator in Python.
+
+
+**Example:**
+```python
+print(2 == 2)
+```
+
+**Output:**
+```plaintext
+True
+```
+
+
+**Example:**
+```python
+print(2 == 3)
+```
+
+**Output:**
+```plaintext
+False
+```
+
+**We can compare:**
+- **int and int**
+- **int and float**
+
+
+**Example:**
+```python
+print(2 == 2.0)
+```
+
+**Output:**
+```plaintext
+True
+```
+
+
+**Example:**
+```python
+print(2 == 2.00001)
+```
+
+**Output:**
+```plaintext
+False
+```
+
+- **int and string**
+
+**Example:**
+```python
+print(2 == '2')
+```
+
+**Output:**
+```plaintext
+False
+```
+
+- **int and None**, if we compare a value with none, we always get a False result.
+
+
+**Example:**
+```python
+print(2 == None)
+```
+
+**Output:**
+```plaintext
+False
+```
+
+But we can compare any type value with any other value type.
+
+
+### Not Equal
+`!=` is a not equal operator in Python.
+
+
+**Example:**
+```python
+print(2 != '2')
+```
+
+**Output:**
+```plaintext
+True
+```
+
+**Example:**
+```python
+print('2' != '22')
+```
+
+**Output:**
+```plaintext
+True
+```
+
+**Example:**
+```python
+print('Aakar' != 'Aakar')
+```
+
+**Output:**
+```plaintext
+False
+```
+
+
+**Example:**
+```python
+print('ABC' != 'abc')
+```
+
+**Output:**
+```plaintext
+True
+```
+
+**Explaination:**
+As python is a case sensitive language so `ABC` and `abc` are considered different.
+
+### Less Than / Greater Than
+
+**Example:**
+```python
+print(2 < 3)
+```
+
+**Output:**
+```plaintext
+True
+```
+
+We can not compare integer and string values.
+
+**Example:**
+```python
+print(2 < '2')
+```
+
+**Output:**
+```plaintext
+TypeError Traceback (most recent call last)
+Cell In[65], line 1
+----> 1 print(2<'2')
+TypeError: '<' not supported between instances of 'int' and 'str'
+```
+
+We can have a comparison between integer and float values.
+
+**Example:**
+```python
+print(2 < 2.0001)
+```
+
+**Output:**
+```plaintext
+True
+```
+We can not compare integer and None values.
+
+
+**Example:**
+```python
+print(2 < None)
+```
+
+**Output:**
+```plaintext
+TypeError Traceback (most recent call last)
+Cell In[67], line 1
+----> 1 print(2< None)
+TypeError: '<' not supported between instances of 'int' and 'NoneType'
+
+```
+
+
+We can have a comparison between string and string values.
+
+**Example:**
+```python
+print('a' < 'b')
+```
+
+**Output:**
+```plaintext
+True
+```
+
+
+
+
+
+**Example:**
+```python
+print('Vicky' < 'Kusum') # Will be covered in String class
+```
+
+**Output:**
+```plaintext
+False
+```
+
+We can also do a comparison with negative values.
+
+
+**Example:**
+```python
+print(2 > -3.43)
+```
+
+**Output:**
+```plaintext
+True
+```
+
+
+**Example:**
+```python
+print(100 >= 32)
+```
+
+**Output:**
+```plaintext
+True
+```
+
+
+**Example:**
+```python
+print(31 <= -43)
+```
+
+**Output:**
+```plaintext
+False
+```
+
+
+---
+## Assignment Operator
+
+`=` is an assignment operator, it will assigne value to the variable.
+
+**Example:**
+```python
+a = 2 + 5
+print(a)
+```
+**Output:**
+```plaintext
+7
+```
+
+
+### Shorthand
+In place of `a = a (op) b`, we can write `a (op)= b`.
+
+
+
+**Example:**
+```python
+a = 1
+a = a + 5
+print(a)
+
+
+
+a = 1
+a += 5
+print(a)
+```
+**Output:**
+```plaintext
+6
+6
+```
+
+
+
+**Example:**
+```python
+a = 11
+a = a % 5
+print(a)
+
+a = 11
+a %= 5
+print(a)
+```
+**Output:**
+```plaintext
+1
+1
+```
+
+
+---
+## Logical Operator
+We have the following logical operators:
+* And (Both the values should be True then True otherwise False)
+* Or (Any of the values should be true then True otherwise False)
+* Not (Reverse)
+
+**Logical operator always takes bool as input**
+
+### AND
+The truth table of AND:
+
+* True and True -> True
+* True and False -> False
+* False and True -> False
+* False and False -> False
+
+AND will only give True output, if we have both values True, otherwise in all other cases(if any one value is False) it will give us False.
+
+
+
+**Example:**
+```python
+(2 < 3) and (2 < 4)
+```
+**Output:**
+```plaintext
+True
+```
+Both conditions result is True, so AND will also give True.
+
+
+**Example:**
+```python
+('Aakar' == 'Aakar') and (-2 < -3)
+```
+**Output:**
+```plaintext
+False
+```
+
+`(-2<-3)` gives False, so AND will also give False.
+
+### OR
+The truth table of OR:
+
+* True or True -> True
+* True or False -> True
+* False or True -> True
+* False or False -> False
+
+OR will give a True output, if any one of the input values is True, and it will give False only if both input values are False.
+
+
+
+**Example:**
+```python
+(2 < 3) or (2 < 4)
+```
+**Output:**
+```plaintext
+True
+```
+
+
+
+**Example:**
+```python
+('Aakar' == 'aakar') or (-2 < -3)
+```
+**Output:**
+```plaintext
+False
+```
+
+Both conditions give us False, so the output will also be False.
+
+
+**Example:**
+```python
+('Aakar' == 'aakar')
+```
+**Output:**
+```plaintext
+False
+```
+
+
+
+**Example:**
+```python
+(-2 < -3)
+```
+**Output:**
+```plaintext
+False
+```
+
+
+
+### Not
+`not` is Not operator.
+Truth Table
+* not True -> False
+* not False -> True
+
+
+
+**Example:**
+```python
+not ('Aakar' == 'aakar')
+```
+
+**Output:**
+```plaintext
+True
+```
+
+`('Aakar' == 'aakar')` will give us False, and not False gives us True.
+
+
+
+
+---
+### Question
+What is the output of the following?
+`print(10 <= 8)`
+
+**Choices**
+
+- [ ] True
+- [x] False
+
+
+
+
+---
+### Question
+What is the output of the following?
+`print(False == 1)`
+
+**Choices**
+
+- [ ] True
+- [x] False
+- [ ] Error
+
+
+
+
+---
+### Question
+What is the output of the following?
+`print('1' < 2)`
+
+**Choices**
+
+- [ ] True
+- [ ] False
+- [x] Error
+
+
+
+---
+### Question
+What is the output of the following?
+```python
+a = 3
+a *= 4
+print(a)
+```
+
+**Choices**
+
+- [ ] 3
+- [ ] 4
+- [ ] 7
+- [x] 12
+
+
+
+---
+### Question
+What is the output of the following?
+```python
+print(True and (not False))
+```
+
+**Choices**
+
+- [x] True
+- [ ] False
+- [ ] Error
+
+
+
+---
+## Conditional Statements
+A conditional statement is a Boolean expression that, if True, executes a piece of code.
+A conditional statement has some conditions, if it will be true then we have some piece of code to execute, and if it is false, then we have another piece of code to execute.
+
+
+
+
+
+There are the following Conditional patterns in Python:
+* if
+* if else
+* if elif
+* if elif else
+
+
+**Python is an indentation-based language,** in place of curly braces for blocks we use the same indentation for a single block code.
+
+### if
+
+```python
+if():
+ this
+ is
+ a
+ block
+```
+
+`()` is not necessary in Python for specifying the conditions.
+
+Any number of spaces can give us an indentation, but a single block has the same indentation for all lines.
+
+**Example:**
+```python
+if(2 < 3):
+ print('two is less')
+```
+
+**Output:**
+```plaintext
+two is less
+```
+
+If we add extra indentation in the same block, then it will give an error.
+
+
+**Example:**
+```python
+if(2 < 3):
+ print('two is less')
+ print('yayy') # will not work because of extra indentation
+```
+
+**Output:**
+```plaintext
+Cell In[107], line 3
+ print('yayy') # will not work because of extra indentation
+ ^
+IndentationError: unexpected indent
+```
+
+
+if block will only be executed if condition, otherwise normal flow will be continued.
+
+
+
+**Example:**
+```python
+if(2 > 3):
+ print('two is less')
+print('yayy')
+```
+
+**Output:**
+```plaintext
+yayy
+```
+
+
+### If Else
+if the condition is True, then the `if` block code will be executed, otherwise `else` block code will be executed.
+
+
+**Example:**
+```python
+if(2 > 3):
+ print('two is greater than 3')
+else:
+ print('two is not greater than 3')
+print('yayy')
+```
+
+**Output:**
+```plaintext
+two is not greater than 3
+yayy
+```
+
+### elif
+
+`elif` is used for checking multiple conditions.
+
+**Example:**
+```python
+weather = input('What the weather like? ')
+if(weather == 'Sunny'):
+ print('Take Googles')
+elif (weather == 'Rainy'):
+ print('Take Umbrella')
+elif (weather == 'Snowy'):
+ print('wear boots')
+else:
+ print('I dont know this weather')
+print('normal execution')
+```
+
+`else` is optional here, it is executed if any of the conditions is not true.
+
+
+**Output 1:**
+```plaintext
+What the weather like? Sunny
+Take Googles
+normal execution
+```
+
+**Output 2:**
+```plaintext
+What the weather like? Mist
+I dont know this weather
+normal execution
+```
+
+
+
+
+---
+## Problem Statement: Traffic Lights
+
+You have to ask about the color of the traffic light from the user, if:
+- it is green, then print go,
+- it is yellow, then print wait,
+- it is red, then print stop
+
+
+* green -> go
+* yellow -> wait
+* red -> stop
+
+:::warning
+Please take some time to think about the solution on your own before reading further.....
+:::
+
+
+### Solution
+
+**Code:**
+```python
+light = input()
+if (light == 'green'):
+ print('go')
+elif (light == 'yellow'):
+ print('wait')
+elif (light == 'red'):
+ print('stop')
+else:
+ print('Wrong input')
+```
+
+**Output 1:**
+```plaintext
+green
+go
+```
+
+**Output 2:**
+```plaintext
+yellow
+wait
+```
+
+**Output 3:**
+```plaintext
+red
+stop
+```
+
+
+**Output 4:**
+```plaintext
+asgsg
+Wrong input
+```
+
+
+---
+## Problem Statement: Maximum of two
+ Given two integers, print the maximum of them.
+
+### Solution
+
+**Code:**
+```python
+a = int(input())
+b = int(input())
+if(a > b):
+ print('Maximum of two is', a)
+else:
+ print('Maximum of two is', b)
+```
+
+
+**Output 1:**
+```plaintext
+100
+-100
+Maximum of two is 100
+```
+
+
+**Output 2:**
+```plaintext
+12
+22
+Maximum of two is 22
+```
+
+
+---
+## Problem Statement: Maximum of two and check equality also
+Given two integers, print the maximum of them or say both are equal.
+
+### Solution
+
+:::warning
+Please take some time to think about the solution on your own before reading further.....
+:::
+
+
+**Code:**
+```python
+a = int(input())
+b = int(input())
+if(a == b):
+ print('Both numbers are equal')
+elif(a > b):
+ print('Maximum of two is', a)
+else:
+ print('Maximum of two is', b)
+```
+
+
+**Output 1:**
+```plaintext
+100
+100
+Both numbers are equal
+```
+
+
+**Output 2:**
+```plaintext
+12
+22
+Maximum of two is 22
+```
+
+
+---
+## Problem Statement: Check even or odd
+Take an integer and print if it is even or odd
+
+### Solution
+
+**Code:**
+```python
+a = int(input())
+if(a % 2 == 0):
+ print('Number is even')
+else:
+ print('Number is odd')
+```
+
+**Output:**
+```plaintext
+-3
+Number is odd
+```
+
+
+---
+## Problem Statement: Print the grade
+
+Take marks as input, then print the grade accordingly as given below:
+* A --> (90, 100]
+* B --> (80, 90]
+* C --> (70, 80]
+* D --> [0, 70]
+
+**Take it as homework**
+
+---
+## Problem Statement: FizBuz
+Given an integer as input:
+* if it is only a multiple of 3 print only Fizz
+* if it is only a multiple of 5 print only Buzz
+* if it is a multiple of both 3 and 5 print Fizz-Buzz
+
+### Solution
+n be a multiple of a if **n%a == 0**
+
+**Code:**
+```python
+a = int(input())
+if (a % 3 == 0 and a % 5 == 0):
+ print('Fizz-Buzz')
+elif (a % 3 == 0):
+ print('Fizz')
+elif (a % 5 == 0):
+ print('Buzz')
+```
+
+**Output 1:**
+```plaintext
+15
+Fizz-Buzz
+```
+
+**Output 2:**
+```plaintext
+27
+Fizz
+```
+
+**Output 3:**
+```plaintext
+25
+Buzz
+```
+
+**Output 4:**
+```plaintext
+8
+```
+
+
+
+---
+### Question
+What is the output of the following?
+```python
+a = 5
+if(a < 6):
+ print('Option 1')
+if(a < 3):
+ print('Option 2')
+else:
+ print('Option 3')
+```
+
+**Choices**
+
+- [ ] Option 1
+- [ ] Option 2
+- [ ] Option 3
+- [x] Option 1
+ Option 3
+
+
+
+```python
+a = 5
+if(a < 6):
+ print('Option 1')
+if(a < 3):
+ print('Option 2')
+else:
+ print('Option 3')
+```
+
+If we see in the code,
+```python
+a = 5
+if(a < 6):
+ print('Option 1')
+```
+
+```python
+if(a < 3):
+ print('Option 2')
+else:
+ print('Option 3')
+```
+
+Both these codes have separate conditions, so in the first condition, it will check for `if(a < 6)`, then again it will check for `if(a < 3)`, and in this case condition will be false, so `else` will be executed.
+
+
+
+---
+## Nested if
+We can have another `if` inside the `if`.
+
+**Example:**
+```python
+a = input('Is your character Male?')
+if(a == 'yes'):
+ b = input('Is your character good?')
+ if(b == 'yes'):
+ print('Your chacter name is chota Bheem')
+ else:
+ print('Your character name is Kaliya')
+else:
+ print('Your character name is chutki')
+
+```
+
+**Output 1:**
+```plaintext
+Is your character Male?yes
+Is your character good?no
+Your character name is Kaliya
+```
+
+**Output 2:**
+```plaintext
+Is your character Male?no
+Your character name is chutki
+```
+
+**Homework:** Make a small game over some concept
+
+
+---
+## Operators Hierarchy(Precedence)
+
+Operators Precedence In Python.
+
+
+
+
+- High precedence operators are calculated first.
+- For operators with the same precedence will be evaluated from left to right.
+
+**Example 1:**
+`3 * 10 / 2`
+
+**Solution**
+`*` and `/` have the same precedence so we will evaluate it from left to right.
+
+`= ((3 * 10) / 2)`
+`= 30 / 2`
+`= 15`
+
+**Answer:** 15
+
+
+**Example 2:**
+`10 - 5 / 5`
+
+**Solution**
+`/` have higher precedence than `-` so first `/` will be evaluated, then `-` will be evaluated
+
+`= 10 - 1`
+`= 9`
+
+**Answer:** 9
+
+
+**Example 3:**
+`45 % 10 / 2`
+
+**Solution**
+`%` and `/` have the same precedence so we will evaluate it from left to right.
+
+`= ((45 % 10) / 2)`
+`= 5 / 2`
+`= 2.5`
+
+**Answer:** 2.5
+
+
+**Example 4:**
+`True and not False`
+
+**Solution**
+`not` has higher precedence than `and`, so first `not` will be evaluated, then `and` will be evaluated
+
+`= True and (not False)`
+`= True and True`
+`= True`
+
+**Answer:** True
+
+
+**Example 5:**
+`False or not False and True`
+
+**Solution**
+`not` has higher precedence than `or` and `and`, so first `not` will be evaluated, then between`and` and `or`, `and` have higher precedence, so `and` will be evaluated then `or` will be evaluated.
+
+`= False or (not False) and True`
+`= False or (True and True)`
+`= False or True`
+`= True`
+
+**Answer:** True
\ No newline at end of file
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Sets and Dictionaries.md b/Academy DSA Typed Notes/Python Refresher/Refresher Sets and Dictionaries.md
new file mode 100644
index 0000000..9da72b3
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Sets and Dictionaries.md
@@ -0,0 +1,1196 @@
+# Refresher: Sets and Dictionaries
+
+## Content covered till now
+1. Data Types
+2. Operators
+3. Loops
+4. Functions
+5. List
+6. Tuples
+7. String
+8. Sets & Dictionaries (today)
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = [1, 2, 3, 4, 5]
+print('|'.join(a))
+```
+
+**Choices**
+
+- [ ] 1|2|3|4|5
+- [x] Error
+- [ ] |1|2|3|4|5|
+
+**Explanation**
+```python
+a = [1, 2, 3, 4, 5]
+print('|'.join(a))
+```
+
+`join()` takes an iterable of string but here we are giving an iterable of integer so it will give us an error.
+
+**Output:**
+```plaintext
+TypeError Traceback (most recent call last)
+Cell In[5], line 2
+ 1 a = [1, 2, 3, 4, 5]
+----> 2 print('|'.join(a))
+TypeError: sequence item 0: expected str instance, int found
+```
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 'scaler123'
+print(a.isaplha())
+```
+
+**Choices**
+
+- [ ] True
+- [x] False
+
+
+**Explanation**
+```python
+a = 'scaler123'
+print(a.isaplha())
+```
+
+The output will be false as `scaler123` does not have only alphabets it also has numbers.
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 'scaler123'
+print(a.endswith('ler'))
+```
+
+**Choices**
+
+- [ ] True
+- [x] False
+
+
+
+---
+## Introduction to Dictionary
+In other languages dictionary is also known as a map.
+The dictionary is basically a place where we have words with their meanings.
+And every word in the dictionary is unique, but it is not necessary that two can not have the same meaning.
+
+
+**Properties of dictionary**
+* Stores key-value pair.
+* Key is unique, value may or may not be unique
+* Dictionary is an iterable.
+* Dictionary has key and value, both keys and values are iterable.
+* Dictionary is mutable, which means we can change the dictionary after defining it.
+* Python dictionaries are not ordered.
+* Python dictionaries are heterogeneous.
+* The key needs to be an immutable data type.
+
+### Initialization
+The dictionary can be initialized in two ways:
+- Using `{}`.
+- Using `dict()`, it takes a list of iterables and converts them to the dictionary.
+
+**Example:**
+```python
+d = {} # empty dictionary
+print(d)
+print(type(d))
+```
+
+**Output:**
+```plaintext
+{}
+
+```
+
+
+
+**Example:**
+```python
+d = dict() # empty dictionary
+print(d)
+print(type(d))
+```
+
+**Output:**
+```plaintext
+{}
+
+```
+
+
+We are just making an example dictionary using `{}`, and we can **print a dictionary by just its name**.
+
+**Example:**
+```python
+d = {'a': 1, 'b': 1}
+print(d)
+```
+
+**Output:**
+```plaintext
+{'a': 1, 'b': 1}
+```
+
+If we try to store duplicate keys then the previous value of the key will be overridden.
+
+
+**Example:**
+```python
+d = {'a': 1, 'a': 10}
+print(d)
+```
+
+**Output:**
+```plaintext
+{'a': 10}
+```
+
+
+**Dictionary can't have mutable keys,** we can have a tuple as a key, but we can't use a list, set, or dictionary as a key.
+
+**Example:**
+```python
+a = {[1,2,3]: 'abc'} # can't have mutable keys.
+```
+
+**Output:**
+```plaintext
+TypeError Traceback (most recent call last)
+Cell In[37], line 1
+----> 1 a = {[1,2,3]: 'abc'} # can't have immutable keys.
+TypeError: unhashable type: 'list'
+```
+
+The below code will work, as we can use the tuple as a key.
+**Example:**
+```python
+a = {(1,2,3): 'abc'} # can't have mutable keys.
+```
+
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+print(type(nicknames))
+print(nicknames)
+```
+
+**Output:**
+```plaintext
+
+{'Madhuri': 'Sweety', 'Vinoth': 'Appu', Shubham': 'Zoo Zoo', 'Kusum': 'ku ku', 'Aakar': 'Golu'}
+```
+
+**Python dictionaries are not ordered,** all the elements in the dictionary will be inserted at any random position, so we cannot get values by indexes in the dictionary.
+
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+# Indexing
+# Dont have indexing
+print(nicknames[0])
+```
+
+**Output:**
+```plaintext
+KeyError Traceback (most recent call last)
+Cell In[18], line 4
+ 1 # Indexing
+ 2
+ 3 # Dont have indexing
+----> 4 print(nicknames[0])
+KeyError: 0
+```
+
+**Accessing value from the dictionary using a key.**
+
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+# Get value
+print(nicknames['Madhuri'])
+```
+
+**Output:**
+```plaintext
+Sweety
+```
+
+If the key does not exist in the dictionary, then we will get an error.
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+# Get value
+print(nicknames['Manish'])
+```
+
+**Output:**
+```plaintext
+KeyError Traceback (most recent call last)
+Cell In[20], line 1
+----> 1 print(nicknames['Manish'])
+KeyError: 'Manish'
+```
+
+
+The `get()` method is also used to get the key value, and if the key does not exist it will not give an error, then it will simply print `None`.
+
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+print(nicknames.get('Vicky'))
+```
+
+**Output:**
+```plaintext
+None
+```
+
+We can also the value which will be displayed if the key does not exist, as in the below key `Manish` does not exist in the dictionary, so `Oye` will be printed.
+
+
+
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+print(nicknames.get('Manish', 'Oye'))
+```
+
+**Output:**
+```plaintext
+Oye
+```
+
+
+But if a key exists in the dictionary then its value will be printed.
+
+**Example:**
+```python
+nicknames = {
+ "Madhuri": "Sweety",
+ "Vinoth": "Appu",
+ "Shubham": "Zoo Zoo",
+ "Kusum": "ku ku",
+ "Aakar": "Golu"
+}
+print(nicknames.get('Madhuri', 'Oye'))
+```
+
+**Output:**
+```plaintext
+Sweety
+```
+
+
+
+
+
+**Dictionary are heterogeneous in Python,** means we can store different data type keys and values in a single dictionary.
+
+
+**Example:**
+```python
+# Showing the heterogeneous nature of dict
+a = {True: 'a', 'a': 1, 2: False, 3.14: 'pi'}
+print(a)
+```
+
+**Output:**
+```plaintext
+{True: 'a', 'a': 1, 2: False, 3.14: 'pi'}
+```
+
+### insert
+
+We can simply assign a value for a new key.
+
+The below code will add a key `Manish` with the value `Monu` in the dictionary `nicknames`.
+
+**Example:**
+```python
+# Insert
+nicknames['Manish'] = 'Monu'
+print(nicknames)
+```
+
+**Output:**
+```plaintext
+{'Madhuri': 'Sweety', 'Vinoth': 'Appu', 'Shubham': 'Zoo Zoo', 'Kusum': 'ku ku', 'Aakar': 'Golu', 'Manish': 'Monu'}
+
+```
+
+Now if we try to get the `Manish` value, then its value will be printed as it is now available in the dictionary.
+
+**Example:**
+```python
+print(nicknames.get('Manish', 'Oye'))
+```
+
+**Output:**
+```plaintext
+Monu
+```
+
+
+### update
+
+We can simply assign a new value for a key.
+
+The below code will update the value of key `Kusum`.
+
+**Example:**
+```python
+# Update
+nicknames['Kusum'] = 'Ku Ku'
+print(nicknames)
+```
+
+**Output:**
+```plaintext
+{'Madhuri': 'Sweety', 'Vinoth': 'Appu', 'Shubham': 'Zoo Zoo', 'Kusum': 'Ku Ku', 'Aakar': 'Golu', 'Manish': 'Monu'}
+```
+
+**In dict, you can't update the keys. If you want to update a key, delete the old one and add a new one.**
+
+### Length of a Dictionary
+
+`len()` will print the length of the dictionary, and it will print a number of key-value pairs of the dictionary.
+
+**Example:**
+```python
+# Length of a dictionary - Number of keys, value pair.
+print(len(nicknames))
+```
+
+**Output:**
+```plantext
+6
+```
+
+### delete
+
+We can delete the key in two ways:
+- using `pop()`.
+- using `del`.
+
+
+**Deletion using pop():**
+We can give the key and default value to the `pop()`, it will delete the key, if the key is present then it will return its value from the dictionary, otherwise, it will return the default value.
+
+If the key is not present in the dictionary and if the default value is not also provided then it will give a `keyError`.
+
+**Example:**
+```python
+print(nicknames.pop('AAkar'))
+```
+
+**Output:**
+```plantext
+KeyError Traceback (most recent call last)
+Cell In[39], line 3
+ 1 # Delete
+ 2 # type 1
+----> 3 print(nicknames.pop('AAkar'))
+KeyError: 'AAkar'
+```
+
+As we have given a non-existing key and also not provided the default value, it will give an error.
+
+
+
+**Example:**
+```python
+print(nicknames.pop('AAkar', 'Oye'))
+```
+
+**Output:**
+```plantext
+Oye
+```
+
+
+The above key does not exist, but we have provided the default value, so it will return the default value.
+
+
+**Example:**
+```python
+print(nicknames)
+```
+
+**Output:**
+```plantext
+{'Madhuri': 'Sweety', 'Vinoth': 'Appu', 'Shubham': 'Zoo Zoo', 'Kusum': 'Ku Ku', 'Aakar': 'Golu', 'Manish': 'Monu'}
+```
+
+
+If a key exists in the dictionary, then it will be deleted from the dictionary and its value will be returned.
+
+**Example:**
+```python
+print(nicknames.pop('Aakar', 'Oye'))
+print(nicknames)
+```
+
+**Output:**
+```plantext
+Golu
+{'Madhuri': 'Sweety', 'Vinoth': 'Appu', 'Shubham': 'Zoo Zoo', 'Kusum': 'Ku Ku', 'Manish': 'Monu'}
+```
+
+**Deletion using del:**
+`del` can be used for deleting the key from the dictionary.
+
+
+**Example:**
+```python
+nicknames['Aakar'] = 'Golu'
+del nicknames['Aakar']
+print(nicknames)
+```
+
+**Output:**
+```plantext
+{'Madhuri': 'Sweety', 'Vinoth': 'Appu', 'Shubham': 'Zoo Zoo', 'Kusum': 'Ku Ku', 'Manish': 'Monu'}
+```
+
+The above code will delete key Aakar from the dictionary.
+
+
+`del` only deletes the key but `pop()` will also return the value of the key after deleting it.
+
+
+### Keys of Dictionary
+The `key()` function is used to get all the keys of the dictionary.
+
+**Example:**
+```python
+print(nicknames.keys())
+```
+
+**Output:**
+```plaintext
+dict_keys(['Madhuri', 'Vinoth', 'Shubham', 'Kusum', 'Manish'])
+```
+
+
+### Values of Dictionary
+The `values()` function is used to get all values of the dictionary.
+
+**Example:**
+```python
+print(nicknames.values())
+```
+
+**Output:**
+```plaintext
+dict_values(['Sweety', 'Appu', 'Zoo Zoo', 'Ku Ku', 'Monu'])
+```
+
+
+### Iterations in a Dictionary
+
+Iterations are printing the key value of the dictionary but in different lines. We can iterate in two ways:
+
+**Way 1:**
+Iterating using the key of the dictionary.
+
+
+
+**Example:**
+```python
+for key in nicknames.keys():
+ print(f"{key}'s nickname is {nicknames[key]}")
+```
+
+**Output:**
+```plaintext
+Madhuri's nickname is Sweety
+Vinoth's nickname is Appu
+Shubham's nickname is Zoo Zoo
+Kusum's nickname is Ku Ku
+Manish's nickname is Monu
+```
+
+
+
+**Way 2:**
+Iterating using `items()`, will give both key-value pairs of the dictionary.
+
+
+
+**Example:**
+```python
+for key, value in nicknames.items():
+ print(f"{key}'s nickname is {value}")
+```
+
+**Output:**
+```plaintext
+Madhuri's nickname is Sweety
+Vinoth's nickname is Appu
+Shubham's nickname is Zoo Zoo
+Kusum's nickname is Ku Ku
+Manish's nickname is Monu
+```
+
+
+## in
+`in` is used to check whether the key is present in a dictionary or not.
+
+
+**Example:**
+```python
+'Nafeesa' in nicknames
+```
+
+**Output:**
+```plaintext
+False
+```
+
+
+
+**Example:**
+```python
+'Kusum' in nicknames
+```
+
+**Output:**
+```plaintext
+True
+```
+
+We can not check the presence of value in a dictionary using the `in` operator.
+
+**Example:**
+```python
+'Ku Ku' in nicknames
+```
+
+**Output:**
+```plaintext
+False
+```
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python=
+a = {'a': 'A'}
+print(type(a))
+```
+
+**Choices**
+
+- [ ] str
+- [ ] list
+- [x] dict
+- [ ] tuple
+
+
+
+
+---
+## Problem Statement Count frequency of characters
+Given a string, count the number of characters used.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Explanation
+Take a string as input, and print the frequencies of every unique character of the string.
+
+
+### Test Cases
+**Input:**
+`input = 'Aakar Sharma'`
+
+**Output:**
+```plaintext
+print
+A - 1
+a - 4
+k - 1
+r - 2
+S - 1
+' ' - 1
+h - 1
+m - 1
+```
+
+
+### Solution
+
+We can create a dictionary to store every character as a key and frequency as a value, When we get a new character we store it with a frequency 1, and if the character is already present in the dictionary then we will simply increment its frequency by 1.
+
+
+
+**Code 1:**
+```python
+s = input()
+freq = {}
+for char in s:
+ if(char in freq):
+ freq[char] += 1
+ else:
+ freq[char] = 1
+print(freq)
+```
+
+
+**Output:**
+
+```plaintext
+Aakar Sharma
+{'A': 1, 'a': 4, 'k': 1, 'r': 2, ' ': 1, 'S': 1, 'h': 1, 'm': 1}
+```
+
+
+
+**Code 2:**
+```python
+s = input()
+freq = {}
+for char in s:
+ freq[char] = freq.get(char, 0) + 1
+print(freq)
+```
+
+
+**Output:**
+
+```plaintext
+Aakar Sharma
+{'A': 1, 'a': 4, 'k': 1, 'r': 2, ' ': 1, 'S': 1, 'h': 1, 'm': 1}
+```
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+d = {'a': 1, 'b': 2, 'c': 3}
+print(d[1])
+```
+
+**Choices**
+
+- [ ] a
+- [ ] b
+- [ ] None
+- [x] KeyError
+
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = {'Scaler': 1}
+a.pop('Scaler')
+print(len(a))
+```
+
+**Choices**
+
+- [ ] 1
+- [x] 0
+- [ ] None
+- [ ] Error
+
+
+
+
+---
+## Sets
+Sets are data structures which store unique elements.
+
+**Properties of sets:**
+* Sets are unordered, which means we can not use indexing.
+* Sets are iterable
+* Sets are heterogeneous, which means they can have any data type value.
+* Sets should only contain immutable data types.
+
+
+### Initialization
+Sets are initialized using `{}`, and elements are separated by commas.
+
+**Example:**
+```python
+# Initialization
+a = {1, 2,3,1,2,3}
+print(a)
+print(type(a))
+```
+
+**Output:**
+```plaintext
+{1, 2, 3}
+
+```
+
+
+### Defining set using set()
+
+`set()` is used to define a set, we can also define an empty set by `set()`, as `{}` will not work as an empty set, it will be considered as an empty dictionary.
+
+
+**Example:**
+```python
+a = set()
+print(type(a))
+```
+
+**Output:**
+```plaintext
+
+```
+
+### Indexing Does Not Work in Set
+As sets are unordered, so we cannot use indexing in the set.
+
+
+**Example:**
+```python
+# Indexing
+# Does not work, because sets are unordered.
+colors = {'red', 'green', 'yellow'}
+print(colors)
+print(colors[0])
+```
+
+**Output:**
+```plaintext
+{'red', 'yellow', 'green'}
+--------------------------------------------------------------------
+-------
+TypeError Traceback (most recent call last)
+Cell In[70], line 6
+ 4 colors = {'red', 'green', 'yellow'}
+ 5 print(colors)
+----> 6 print(colors[0])
+TypeError: 'set' object is not subscriptable
+```
+
+
+### Insert
+The `add()` function is used to add elements in the set.
+
+
+
+
+**Example:**
+```python
+colors.add('black')
+print(colors)
+```
+
+**Output:**
+```plaintext
+{'red', 'yellow', 'green', 'black'}
+```
+
+
+### Update
+`update()` will not update the existing value of the set, it is simply used to add multiple values in the set, we can add iterables using `update()` in the set.
+
+
+**Example:**
+```python
+# Update - just add many values
+li = ['white', 'blue']
+colors.update(li)
+print(colors)
+```
+
+**Output:**
+```plaintext
+{'red', 'yellow', 'white', 'green', 'blue', 'black'}
+```
+
+
+### Deleting an Element from The Set
+`remove()` is used for deleting an element from the set.
+
+
+
+**Example:**
+```python
+# delete an item from a set
+colors.remove('yellow')
+print(colors)
+```
+
+**Output:**
+```plaintext
+{'red', 'white', 'green', 'blue', 'black'}
+```
+
+### Length
+`len()` is used for getting the length of the set.
+
+
+**Example:**
+```python
+# len
+print(len(colors))
+```
+
+**Output:**
+```plaintext
+5
+```
+
+
+### Print/Iterate
+We can iterate a set using a for loop.
+
+
+**Example:**
+```python
+# Print/Iterate
+for color in colors:
+ print(color)
+```
+
+**Output:**
+```plaintext
+red
+white
+green
+blue
+black
+```
+
+### in Operator
+The `in` operator checks whether the element is present in a set or not.
+
+**Example:**
+```python
+# in operator
+'pink' in colors
+```
+
+**Output:**
+```plaintext
+False
+```
+
+
+### Use of Set
+- For storing unique values, when we do not want to store frequency.
+- Given a string, tell a number of unique characters of it.
+
+
+
+
+---
+## Intersection, Union and Difference
+
+Let us assume we have two sets `A` and `B`,
+- `A` represents `food_that_you_like_to_eat = {}`
+- `B` represents `food_that_are_expensive = {}`
+
+### Intersection
+
+In sets `A` and `B`, there can be some food common, which you like to eat and which are expensive also.
+
+Intersection represents a common area of both means foods that are expensive and you like also.
+
+
+
+
+
+### Union
+
+The union represents both the food that you like and the foods that are expensive.
+Union is just a combination of both sets, but the intersection will not be repeated twice in union, it will be once only.
+
+
+
+
+### Difference
+`A - B` represents food that you like but is not expensive, which means we have subtracted `B` from `A`.
+We can also find `B - A`, which represents food that are expensive but you don't like.
+
+
+
+Intersection, Union and Difference will return set as output.
+
+### Intersection, Union and Difference Example in Python
+
+Let us create a set with data
+
+**Code:**
+```python
+food_that_you_like_to_eat = {'Pizza', 'Noodles', 'Pasta', 'Chocolates', 'Burger'}
+food_that_are_expensive = {'Pizza', 'Croissant', 'Avocado'}
+```
+
+So `Pizza` is the only which we like to eat and it is expensive also.
+
+What are things that we like to eat but are not expensive, everything other than pizza will be the answer to this.
+
+Things that are expensive and we don't like to eat are 'Croissant' and 'Avocado'.
+
+**Intersection in Python:**
+
+`intersection()` is used for finding intersection in Python.
+
+**Example:**
+```python
+food_that_you_like_to_eat.intersection(food_that_are_expensive)
+```
+**Output:**
+```plaintext
+{'Pizza'}
+```
+
+**Union in Python:**
+
+`union()` is used for finding union in Python.
+
+**Example:**
+```python
+food_that_you_like_to_eat.union(food_that_are_expensive)
+```
+**Output:**
+```plaintext
+{'Avocado', 'Burger', 'Chocolates', 'Croissant', 'Noodles', 'Pasta', 'Pizza'}
+
+```
+
+
+
+**Difference in Python:**
+
+`difference()` is used for finding difference in Python.
+
+**Example:**
+```python
+food_that_you_like_to_eat.difference(food_that_are_expensive)
+```
+**Output:**
+```plaintext
+{'Burger', 'Chocolates', 'Noodles', 'Pasta'}
+```
+
+We can also find the difference between set by using the `-` symbol.
+
+**Example:**
+```python
+food_that_you_like_to_eat - food_that_are_expensive
+```
+**Output:**
+```plaintext
+{'Burger', 'Chocolates', 'Noodles', 'Pasta'}
+```
+
+
+---
+## Problem Statement: Count unique words
+Given a sentence count the number of unique words.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Solution
+1. We first take the sentence as input, and then we use `split()` to separate it from spaces.
+2. Then we will add every separated word in a set.
+3. At last we will print the size of the set.
+
+**Code:**
+```python
+sentence = input()
+words = sentence.split(' ')
+s = set(words)
+print(len(s))
+print(s)
+```
+
+**Output:**
+```plaintext
+This is a sentence. This is not a paragraph.
+6
+{'sentence.', 'a', 'not', 'This', 'is', 'paragraph.'}
+```
+
+
+
+---
+## Design a game FLAMES
+
+### Design a game: FLAMES
+F - Friends
+L - Love
+A - affair
+M - marriage
+E - enemy
+s - sibling
+
+We will take a girl's and a boy's name, and then we have to find the relationship between them.
+
+
+### Rules
+1. Find out all the unique characters in both names and remove the common characters of both names.
+2. Add both the numbers and find out the respective character in FLAMES.
+3. If the number is greater do round robin.
+
+
+### Example:
+
+**Input**
+```plaintext
+boy = 'aakar sharma'
+girl = 'disha patani'
+```
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+**Solution:**
+1. Find unique characters of both names.
+ - Here boy name has `akrshm` unique characters.
+ - Girl name has `dishaptn` unique characters
+2. Now remove common characters of both, here `a`, `s` and `m` are common, so remove these from both.
+ - `krm`, now it has 3 characters
+ - `diptn`, it has 5 characters.
+3. The sum of both is `3 + 5 = 8`.
+4. `F -> 1`, `L -> 2`, `A -> 3`, `M -> 4`, `E -> 5`, `S -> 6`, then again we start from the first character of FLAMES, `F -> 7`, `L -> 8`.
+5. So we have `L` at 8, **so aakar sharma is in Love with disha patani.**
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = {}
+print(type(a))
+```
+
+**Choices**
+
+- [ ] tuple
+- [ ] list
+- [x] dict
+- [ ] set
+
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+l = [1, 1, 2, 2, 3, 3]
+s = set(l)
+print(len(s))
+```
+
+**Choices**
+
+- [ ] 6
+- [x] 3
+- [ ] 2
+- [ ] Error
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = {1, 2, 3}
+b = {3, 4, 5}
+print(a - b)
+print(a.union(b))
+print(a.intersection(b))
+```
+
+**Choices**
+
+- [ ] [1, 2, 3, 4, 5]
+ [3]
+ [1, 2]
+- [x] [1, 2]
+ [1, 2, 3, 4, 5]
+ [3]
+- [ ] [3]
+ [1, 2]
+ [1, 2, 3, 4, 5]
+- [ ] None of these
+
+
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Strings 2.md b/Academy DSA Typed Notes/Python Refresher/Refresher Strings 2.md
new file mode 100644
index 0000000..3dbb670
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Strings 2.md
@@ -0,0 +1,677 @@
+# Refresher: Strings 2
+
+### Question
+
+What is the output of the following?
+```python
+a = "Age:"
+print(a + 23)
+```
+
+**Choices**
+
+- [ ] Age:23
+- [ ] Age:
+- [x] Error
+- [ ] Age: 23
+
+In the given code, there is an attempt to concatenate a string ("Age:") with an integer (23). This operation is not allowed in Python without explicit conversion and hence will output an error.
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = "Hello"
+b = a * 3
+print(len(b) == (len(a) * 3))
+```
+
+**Choices**
+
+- [x] True
+- [ ] False
+- [ ] Error
+
+The output is True, because the length of the string `b` is compared to the result of multiplying the length of `a` by 3, and they are equal.
+
+---
+### Question
+
+What is the output of the following?
+```python
+s = 'Name : {}, Age : {}'
+print(s.format(25, 'John'))
+```
+
+**Choices**
+
+- [ ] Name : John, Age : 25
+- [x] Name : 25, Age : John
+- [ ] Error
+
+
+The `format` method replaces the `{}` placeholders in the string with the provided values in the order they appear. In this case, `25` is placed where the first `{}` is, and `'John'` is placed where the second `{}` is, resulting in the output "Name : 25, Age : John".
+
+---
+### Question
+
+What is the output of the following?
+```python
+s = 'Name : {name}, Gender : {}, Age : {age}'
+print(s.format('Male', age = 25, name = 'John'))
+```
+
+**Choices**
+
+- [x] Name : John, Gender : Male, Age : 25
+- [ ] Name : Male, Gender : John, Age : 25
+- [ ] Error
+
+
+The `format` method is used to substitute values into the placeholders `{}`, `{name}`, and `{age}` in the string `s`. The values provided in the `format` method are 'Male' for the first placeholder, 'John' for the `{name}` placeholder, and 25 for the `{age}` placeholder. The resulting string is "Name : John, Gender : Male, Age : 25".
+
+
+
+---
+## Count Uppercase Letters
+
+## Count Number of Uppercase Letters
+
+### Problem
+
+Given a string, the task is to count the number of uppercase letters in the string.
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Solution
+
+The solution involves iterating through each character in the string and checking if its ASCII value falls within the range of uppercase letters (A-Z) using the `if` case. Specifically, it ensures that the character is greater than or equal to the ASCII value of 'A' and less than or equal to the ASCII value of 'Z'. For each uppercase letter found, a counter is incremented.
+
+```python
+def count_upper(a):
+ count = 0
+ for char in a:
+ if ord('A') <= ord(char) <= ord('Z'):
+ count += 1
+ return count
+
+# Example Usage
+result = count_upper("ThisIsAString")
+print(result)
+```
+
+### Output
+```plaintext
+4
+```
+
+### Explanation
+
+In this example, the function `count_upper` takes the input string "ThisIsAString" and iterates through each character. For each character that is an uppercase letter, the counter is incremented. The final count is returned, indicating that there are 4 uppercase letters in the input string.
+
+
+
+
+---
+## More Functions in Strings
+
+## More Functions
+
+### join()
+
+### Explanation
+The `join()` method concatenates elements of an iterable using a specified separator.
+
+### Example
+```python
+# Example
+separator = '.'
+result = separator.join(['Hi', 'there'])
+print(result) # Output: 'Hi.there'
+
+# Example 2
+result = '.'.join(['2', '31'])
+print(result) # Output: '2.31'
+
+result = '.'.join([2, 3])
+print(result) # Error
+
+```
+
+#### Explanation
+In this example, the elements 'Hi' and 'there' are joined with a dot (`.`) as the separator, resulting in the string 'Hi.there'.
+
+### upper()
+
+### Explanation
+The `upper()` method converts all characters in a string to uppercase.
+
+### Example
+```python
+# Example
+a = 'ThisIsAString'
+result = a.upper()
+print(result) # Output: 'THISISASTRING'
+
+# Example 2
+a = 'ThisIsAString12348$#'
+result = a.upper()
+print(result) # Output: 'THISISASTRING12348S#'
+
+```
+
+### Explanation
+The `upper()` function transforms all characters in the string 'ThisIsAString' to uppercase, resulting in 'THISISASTRING'.
+
+### lower()
+
+### Explanation
+The `lower()` method converts all characters in a string to lowercase.
+
+### Example
+```python
+# Example
+a = 'ThisIsAString'
+result = a.lower()
+print(result) # Output: 'thisisastring'
+
+# Example 2
+a = 'ThisIsAString12348$#'
+result = a.lower()
+print(result) # Output: 'thisisastring12348$#'
+
+```
+
+### Explanation
+The `lower()` function transforms all characters in the string 'ThisIsAString' to lowercase, resulting in 'thisisastring'.
+
+### isupper()
+
+### Explanation
+The `isupper()` method checks if all characters in a string are uppercase.
+
+### Example
+```python
+# Example
+a = 'AbC1234sg'
+result = a.isupper()
+print(result) # Output: False
+
+# Example 2
+a = 'ABC1234SG'
+result = a.isupper()
+print(result) # Output: True
+```
+
+### Explanation
+The `isupper()` function returns `False` because not all characters in the string 'AbC1234sg' are uppercase. Numbers and special characters are ignored.
+
+### islower()
+
+### Explanation
+The `islower()` method checks if all characters in a string are lowercase, ignoring numbers and special characters.
+
+### Example
+```python
+# Example 1
+a = 'abc1234$#'
+result = a.islower()
+print(result) # Output: True
+
+# Example 2
+a = 'ABC1234$#'
+result = a.islower()
+print(result) # Output: False
+```
+
+### Explanation
+The `islower()` function returns `True` because all characters in the string 'abc1234$#' are lowercase.
+
+### isalpha()
+
+### Explanation
+The `isalpha()` method checks if all characters in a string are alphabetic.
+
+### Example
+```python
+# Example
+a = 'Scaler Academy'
+result = a.isalpha()
+print(result) # Output: False
+
+# Example
+a = 'Scal3rAcademY'
+result = a.isalpha()
+print(result) # Output: False
+```
+
+### Explanation
+The `isalpha()` function returns `False` because the string 'Scaler Academy' contains spaces and is not purely alphabetic. The next example has a number in between and hence is not alphabetic.
+
+### isdigit()
+
+### Explanation
+The `isdigit()` method checks if all characters in a string are digits.
+
+### Example
+```python
+# Example
+a = '123'
+result = a.isdigit()
+print(result) # Output: True
+
+# Example
+a = '1a2b3'
+result = a.isdigit()
+print(result) # Output: False
+```
+
+### Explanation
+The `isdigit()` function returns `True` because all characters in the string '123' are digits. The next example returns `False` because of the alphabetic characters in the string.
+
+### isalnum()
+
+### Explanation
+The `isalnum()` method checks if all characters in a string are alphanumeric.
+
+### Example
+```python
+# Example
+a = 'Abc1234'
+result = a.isalnum()
+print(result) # Output: True
+
+# Example 2
+a = 'Abc12348S#'
+result = a.isalnum()
+print(result) # Output: False
+```
+
+### Explanation
+The `isalnum()` function returns `True` because all characters in the string 'Abc1234' are alphanumeric. The second example has special character, `#` and hence returns `False`.
+
+### endswith()
+
+### Explanation
+The `endswith()` method checks if a string ends with a specified suffix.
+
+### Example
+```python
+# Example
+a = 'Scaler Academy'
+result = a.endswith('Academy')
+print(result) # Output: True
+
+# Example 2
+a = 'Python Programming'
+result = a.endswith('Academy')
+print(result) # Output: False
+```
+
+### Explanation
+The `endswith()` function returns `True` because the string 'Scaler Academy' ends with the specified suffix 'Academy'.
+
+```python
+# Program to Count Alphabets and Digits in a String
+
+# User input
+s = input()
+
+# Initialize counters
+alpha_count = 0
+digit_count = 0
+
+# Iterate through each character in the input string
+for char in s:
+ if char.isalpha():
+ alpha_count += 1
+ elif char.isdigit():
+ digit_count += 1
+
+# Print the result
+print(f'Alphabet count is {alpha_count} and digit count is {digit_count}')
+```
+
+### Explanation
+
+- The program takes user input as a string `s`.
+- Two counters (`alpha_count` and `digit_count`) are initialized to keep track of the number of alphabets and digits.
+- The program iterates through each character in the input string using a `for` loop.
+- For each character, it checks if it is an alphabet using `char.isalpha()` and increments the `alpha_count` accordingly.
+- Similarly, if the character is a digit (`char.isdigit()`), the `digit_count` is incremented.
+- Finally, the program prints the counts using an f-string.
+
+### Example
+
+**Input:**
+```python
+Hello123World
+```
+
+**Output:**
+```plaintext
+Alphabet count is 10 and digit count is 3
+```
+
+In the input string "Hello123World," there are 10 alphabets (H, e, l, l, o, W, o, r, l, d) and 3 digits (1, 2, 3).
+
+
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = [1, 2, 3, 4, 5]
+print('|'.join(a))
+```
+
+**Choices**
+
+- [ ] 1|2|3|4|5
+- [x] Error
+- [ ] |1|2|3|4|5|
+
+The `join` method in Python is used to concatenate a list of strings with a specified delimiter. However, in the given code, the list `a` contains integers, not strings. The `join` method expects a list of strings, so attempting to join a list of integers will result in a TypeError.
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 'Scaler123'
+print(a.upper())
+```
+
+**Choices**
+
+- [ ] Error
+- [ ] Scaler123
+- [ ] sCALER123
+- [x] SCALER123
+
+The `upper()` method in Python is used to convert all characters in a string to uppercase. In this case, the string 'Scaler123' is assigned to variable `a`, and `a.upper()` is then called, resulting in 'SCALER123' as the output.
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 'scaler123'
+print(a.islower())
+```
+
+**Choices**
+
+- [x] True
+- [ ] False
+
+
+The output of the given Python code is `True`. The `islower()` method checks if all the characters in the string are lowercase, and in this case, all characters in the string 'scaler123' are lowercase.
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 'scaler123'
+print(a.isalpha())
+```
+
+**Choices**
+
+- [ ] True
+- [x] False
+
+
+The output of the given Python code is `False`. This is because the `isalpha()` method checks if all the characters in the string are alphabetic (letters) and does not allow for numbers or other characters. In the given string 'scaler123', the presence of '123' makes the method return `False`.
+
+---
+### Question
+
+What is the output of the following?
+```python
+a = 'scaler123'
+print(a.endswith('ler'))
+```
+
+**Choices**
+
+- [ ] True
+- [x] False
+
+
+The output of the given Python code is `False`. This is because the string assigned to variable `a` ('scaler123') does not end with the substring 'ler'. Therefore, the `endswith()` method returns `False`.
+
+---
+## List and String Comparison
+
+### List Comparison
+
+List comparison in Python involves comparing two lists element-wise. The comparison starts from the first elements of both lists, and the result is determined based on the comparison of corresponding elements.
+
+### Example 1
+
+```python
+[1, 2, 3, 4, 5] < [1, 3]
+# Output: True
+```
+
+### Explanation
+In this example, the comparison evaluates to `True` because the first list is considered "less than" the second list. The comparison is element-wise, and it stops as soon as a pair of elements is found where the first element is less than the second element.
+
+### Example 2
+
+```python
+[1, 3, 0] > [1, 3]
+# Output: True
+```
+
+### Explanation
+Here, the comparison evaluates to `True` because the first list is considered "greater than" the second list. Again, the comparison is element-wise, and it stops as soon as a pair of elements is found where the first element is greater than the second element.
+
+### Example 3
+
+```python
+[1, 3] == [1, 3]
+# Output: True
+```
+
+### Explanation
+The comparison `[1, 3] == [1, 3]` checks if both lists are equal element-wise. In this case, the result is `True` because every corresponding pair of elements is the same.
+
+### Example 4
+
+```python
+[1, 2, 3] > [1, 1000, 2000, 3000]
+# Output: True
+```
+
+### Explanation
+The comparison `[1, 2, 3] > [1, 1000, 2000, 3000]` evaluates to `True` because the first list is considered "greater than" the second list. The comparison is still element-wise, and it stops as soon as a pair of elements is found where the first element is greater than the second element.
+
+
+### String Comparison
+
+String comparison in Python involves comparing two strings lexicographically, character by character. The comparison is case-sensitive, with uppercase letters considered "less than" their lowercase counterparts. The comparison stops as soon as a pair of characters is found where the condition (e.g., less than, greater than, equal to) is satisfied. The overall result of the string comparison reflects the outcome of these character-wise comparisons.
+
+### Example 1
+
+```python
+'A' > 'a'
+# Output: False
+```
+
+### Explanation
+In this example, the comparison `'A' > 'a'` evaluates to `False` because, in the ASCII table, uppercase 'A' has a lower ASCII value than lowercase 'a'.
+
+### Example 2
+
+```python
+'Aakar' > 'Sudip'
+# Output: False
+```
+
+### Explanation
+Here, the comparison `'Aakar' > 'Sudip'` evaluates to `False` because, in the lexicographic order, the substring 'Aakar' is considered "less than" the substring 'Sudip'. The comparison stops at the first differing character.
+
+
+
+
+---
+## List Comprehension
+
+List comprehension is a concise way to create lists in Python. It offers a more readable and efficient alternative to traditional loops. The syntax involves expressing the creation of a list in a single line.
+
+### Example 1
+
+```python
+# Create a list of squares till n-1
+n = 5
+li = [i ** 2 for i in range(1, n)]
+print(li) # Output: [1, 4, 9, 16]
+```
+
+This example uses list comprehension to create a list of squares for values from 1 to n-1.
+
+### Example 2
+
+```python
+# Create a list of squares for values from 1 to n
+n = 5
+li = [i ** 2 for i in range(1, n + 1)]
+print(li) # Output: [1, 4, 9, 16, 25]
+```
+
+
+Here, the list comprehension creates a list of squares for values from 1 to n.
+
+### Example 3
+
+```python
+# Create a list of all even elements
+n = 5
+li = [i for i in range(1, n * 2) if i % 2 == 0]
+print(li) # Output: [2, 4, 6, 8, 10]
+```
+
+This example creates a list of all even elements from 1 to n*2 using list comprehension.
+
+### Example 4
+
+```python
+# Create a list of tuples (i, j) for values of i and j in the given range
+n = 3
+li = [(i, j) for i in range(n) for j in range(i)]
+print(li) # Output: [(1, 0), (2, 0), (2, 1)]
+```
+
+This example creates a list of tuples (i, j) using nested list comprehension. It includes pairs where j is less than i.
+
+
+---
+## Pattern Printing
+
+### Pattern 1: Increasing Rows of Stars
+
+
+Print the following pattern ?
+
+```python
+*
+* *
+* * *
+* * * *
+```
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+### Code
+
+```python
+n = int(input())
+for i in range(1, n + 1):
+ print('*' * i)
+```
+
+This code takes an input `n` and uses a loop to print rows of stars. The number of stars in each row increases from 1 to `n`.
+
+### Pattern 2: Right-aligned Triangle
+
+Print the following pattern ?
+
+
+```python
+ *
+ * *
+ * * *
+* * * *
+```
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+To print the given pattern, you can use two nested loops. The outer loop controls the rows, and the inner loop controls the columns. For each row, you need to print spaces followed by asterisks in a specific pattern. Consider the number of spaces needed before each asterisk to achieve the desired right-aligned triangular pattern.
+
+
+### Code
+
+```python
+n = int(input())
+for i in range(1, n + 1):
+ print(' ' * (n - i) + '* ' * i)
+```
+
+This code prints a right-aligned triangle of stars. The number of spaces before the stars decreases, and the number of stars in each row increases.
+
+### Pattern 3: Diamond Pattern
+
+Print the following diamond pattern ?
+```python
+ *
+ ***
+ *****
+ *******
+*********
+ *******
+ *****
+ ***
+ *
+```
+
+:::warning
+Please take some time to think about the solution approach on your own before reading further.....
+:::
+
+
+
+To print the given diamond pattern, you can follow these steps:
+
+1. Observe the pattern carefully, especially how the number of spaces and stars change in each row.
+2. Divide the pattern into two parts: the upper half and the lower half.
+3. For the upper half, start with fewer spaces and more stars, incrementing the number of stars in each row.
+4. For the lower half, start with fewer spaces and more stars, decrementing the number of stars in each row.
+
+### Code
+
+```python
+n = int(input())
+m = n // 2
+
+for i in range(1, m + 1):
+ print(' ' * (m - i) + '*' * (2 * i - 1), sep = '')
+
+for i in range(m, 0, -1):
+ print(' ' * (m - i) + '*' * (2 * i - 1), sep = '')
+```
+
+This code prints a diamond pattern. The first loop prints the upper half, and the second loop prints the lower half of the diamond.
diff --git a/Academy DSA Typed Notes/Python Refresher/Refresher Tuples + Strings 1.md b/Academy DSA Typed Notes/Python Refresher/Refresher Tuples + Strings 1.md
new file mode 100644
index 0000000..365cad5
--- /dev/null
+++ b/Academy DSA Typed Notes/Python Refresher/Refresher Tuples + Strings 1.md
@@ -0,0 +1,684 @@
+# Refresher: Tuples + Strings 1
+# Introduction to Tuples
+
+
+### Introduction
+
+We delve into the fundamentals of Tuples and Strings in Python, two powerful data types that play a crucial role in various programming scenarios. Let's start by understanding the essence of Tuples.
+
+## Planets Example
+
+Let's start with an example using an array to store the names of all the planets in our solar system.
+
+```python
+planets = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"]
+```
+
+### Adding the Sun
+Now, imagine we someone is trying to include the Sun in our list of planets. Since arrays in Python are mutable, someone might be tempted to do this:
+
+```python
+planets.append("Sun")
+```
+
+However, this is where mutability can lead to errors. While the code above will add "Sun" to the list, it's not accurate to consider the Sun a planet. This illustrates a potential problem with mutable structures when trying to maintain data integrity.
+
+## Tuples
+
+### Definition
+
+Now, let's explore tuples - a different kind of data structure. Tuples are similar to arrays but are immutable. This immutability provides certain advantages, especially in situations where data integrity is crucial.
+
+
+### Creating Tuples with Numbers
+We can create a tuple with numbers like this:
+
+```python
+# Definition
+a = (1, 2, 3, 4)
+print(type(a)) # Output:
+
+# Exception
+b = (1,)
+print(type(b)) # Output:
+
+c = (1, 2)
+print(type(c)) # Output:
+
+d = ()
+print(type(d)) # Output:
+```
+
+#### Explanation
+
+ - In the first example, `a` is a tuple containing the numbers 1 through 4. The `type` function confirms that it's indeed a tuple.
+ - The second example, `b`, demonstrates the need for a comma even when creating a tuple with a single element. Without the comma, Python interprets it as a different data type.
+ - The third example, `c`, is a tuple with two elements.
+ - The fourth example, `d`, is an empty tuple.
+
+### Creating Tuples with the range Keyword
+Tuples can also be created using the `range` keyword:
+
+```python
+a = tuple(range(10))
+print(type(a)) # Output:
+print(a) # Output: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
+```
+
+#### Explanation
+
+In this example, `a` is a tuple created using the `tuple` constructor with the `range(10)` function, resulting in a tuple with the numbers 0 through 9.
+
+
+### Tuples in Functions
+
+Consider the following function that swaps the values of two variables:
+
+```python
+def swap(a, b):
+ return b, a
+
+a, b = swap(2, 3)
+```
+
+#### Explanation
+
+In this example, the `swap` function takes two parameters `a` and `b`. Then the function creates and returns a tuple. When the function is called with `swap(2, 3)`, it returns a tuple containing the values of `b` and `a`. This tuple is then unpacked into the variables `a` and `b` on the left side of the assignment statement.
+
+After this line executes, `a` will have the value `3`, and `b` will have the value `2`. This is a powerful and elegant way to swap the values of two variables without needing a temporary variable.
+
+### Partially Immutable Tuples
+
+Consider the following example of a partially immutable tuple:
+
+```python
+# Partially Immutable
+a = (1, 2, 3, ['a', 'b'])
+a[3].append('c')
+print(a)
+```
+
+### Output
+
+The output of this code will be:
+
+```plaintext
+(1, 2, 3, ['a', 'b', 'c'])
+```
+
+### Explanation
+
+Tuples themselves are immutable, but the elements within them may be mutable. In this case, the list inside the tuple is mutable. The line `a[3].append('c')` accesses the fourth element of the tuple (which is a list) and appends the string 'c' to it. Even though the tuple is partially immutable, the list inside it can be modified.
+
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+t = (1, 2, 3)
+t[0] = 4
+print(t)
+```
+
+**Choices**
+
+- [ ] (4, 2, 3)
+- [ ] (1, 2, 3)
+- [x] Error
+
+Tuples in Python are immutable, meaning their elements cannot be modified after creation. In the given code, attempting to assign a new value (`4`) to the first element of the tuple (`t[0]`) will result in an error.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+a = 23
+t = (a)
+print(type(t))
+```
+
+**Choices**
+
+- [ ] tuple
+- [ ] list
+- [ ] str
+- [x] int
+
+The code assigns the value 23 to the variable 'a' and then creates a tuple 't' with a single element, which is the value of 'a'. When the type of 't' is printed, it will output 'int' because the tuple contains only one integer element.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+t = (10, 20, 30, 40)
+print(t[1:-1])
+```
+
+**Choices**
+
+- [ ] 10, 20, 30
+- [ ] Nothing
+- [ ] 20, 30, 40
+- [x] 20, 30
+
+
+The slice `t[1:-1]` extracts elements from index 1 to one position before the last index (-1) in the tuple `t`, resulting in the elements 20 and 30 being printed.
+
+---
+## Strings in Python
+
+## Strings
+
+### String Literals
+
+Strings in Python can be created using single quotes (`'`) or double quotes (`"`). Both forms are equivalent, and you can choose the one that suits your preference. Here's an example:
+
+```python
+a = "abc"
+b = 'abc'
+print(type(a))
+print(type(b))
+```
+
+### Output
+
+```plaintext
+
+
+```
+
+### Explanation
+
+In this example, both `a` and `b` are strings with the content "abc." The `type` function confirms that they are indeed string objects. Python treats single and double quotes as equivalent for defining strings.
+
+### ASCII and Related Functions
+
+ASCII (American Standard Code for Information Interchange) is a character encoding standard that represents each character with a unique number. Python provides `ord` and `chr` functions to work with ASCII values.
+
+```python
+print(ord('A'))
+print(ord('0'))
+print(ord('9'))
+print(chr(129))
+```
+
+### Output
+
+```plaintext
+65
+48
+57
+ü
+```
+
+### Explanation
+
+- `ord('A')` returns the ASCII value of the character 'A', which is 65.
+- `ord('0')` returns the ASCII value of the digit '0', which is 48.
+- `ord('9')` returns the ASCII value of the digit '9', which is 57.
+- `chr(129)` returns the character corresponding to the ASCII value 129, which is 'ü'.
+
+These functions are useful for working with character encodings and converting between characters and their ASCII representations. Keep in mind that ASCII values are integers representing characters in the ASCII table.
+
+
+### Properties of Strings
+
+Strings in Python possess several important properties, including mutability, homogeneity, iterability, and case sensitivity.
+
+```python
+# Variable
+a = 'Scaler Academy'
+```
+
+### Mutability
+
+Strings in Python are **immutable**, meaning their values cannot be changed after creation.
+
+```python
+# Attempt to modify a character in the string
+a[0] = 's'
+```
+
+#### Output
+```plaintext
+TypeError: 'str' object does not support item assignment
+```
+
+#### Explanation
+
+The attempt to modify the first character of the string `a` raises a `TypeError`. This demonstrates the immutability of strings.
+
+### Homogeneity
+
+Strings are **homogeneous**, meaning they can only contain characters of the same type.
+
+```python
+# Concatenating string and integer
+result = a + 42
+```
+
+#### Output
+```plaintext
+TypeError: can only concatenate str (not "int") to str
+```
+
+#### Explanation
+
+Attempting to concatenate a string (`a`) with an integer (`42`) raises a `TypeError`, emphasizing the homogeneity requirement of strings.
+
+### Iterability
+
+Strings are **iterable**, allowing you to loop through each character.
+
+```python
+# Iterating through each character
+for char in a:
+ print(char)
+```
+
+#### Output
+```plaintext
+S
+c
+a
+l
+e
+r
+
+A
+c
+a
+d
+e
+m
+y
+```
+
+#### Explanation
+
+The `for` loop iterates through each character in the string `a`, printing them one by one.
+
+### Case Sensitivity
+
+Strings are **case-sensitive**, distinguishing between uppercase and lowercase characters.
+
+```python
+# Comparing strings
+b = 'scaler academy'
+print(a == b)
+```
+
+#### Output
+```plaintext
+False
+```
+
+#### Explanation
+
+The comparison between `a` and `b` returns `False` because of case sensitivity. The uppercase 'S' in `a` is not equal to the lowercase 's' in `b`.
+
+
+
+---
+### Question
+
+Which one of the following is a valid string?
+
+**Choices**
+
+- [ ] "ScaLer#'
+- [ ] %adfa"
+- [x] "^&abc#"
+- [ ] 'academy'
+
+The correct answer is "^&abc#". This is a valid string because it is enclosed in double quotation marks, and its contents consist of a combination of letters, numbers, and symbols.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+print(ord('c'))
+```
+
+**Choices**
+
+- [ ] 98
+- [x] 99
+- [ ] 100
+- [ ] 101
+
+The correct answer is 99. The `ord` function in Python returns the Unicode code point of a given character. In this case, it prints the Unicode code point of the character 'c', which is 99.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+print(chr(70))
+```
+
+**Choices**
+
+- [ ] C
+- [ ] E
+- [x] F
+- [ ] G
+
+The `chr()` function in Python returns a string representing a character whose Unicode code point is the integer passed to it. In this case, `chr(70)` returns the character with Unicode code point 70, which is 'F'.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+s = 'Scaler Academy'
+print(s[0:5])
+```
+
+**Choices**
+
+- [ ] Sae
+- [ ] Scaler
+- [x] Scale
+- [ ] cale
+
+
+The code `s[0:5]` extracts the substring from index 0 to 4 (5 exclusive) from the string 'Scaler Academy', resulting in the output 'Scale'.
+
+---
+### Question
+
+What will be the output of the following?
+```python
+a = '1'
+b = '2'
+c = a + b
+print(c)
+```
+
+**Choices**
+
+- [ ] 3
+- [ ] '3'
+- [x] 12
+- [ ] 1 2
+
+The correct answer is: 12
+
+In Python, when you use the `+` operator with two strings, it concatenates them. So, `a + b` where `a` is '1' and `b` is '2' results in the string '12', and that is what will be printed.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+a = 'abcd'
+a += 'e'
+print(len(a))
+```
+
+**Choices**
+
+- [ ] 3
+- [ ] 4
+- [x] 5
+- [ ] 6
+
+
+The code initializes a string variable 'a' with the value 'abcd', then concatenates 'e' to it using the `+=` operator. Finally, it prints the length of the modified string 'a', which is now 'abcde'. The length of 'abcde' is 5, so the output is 5.
+
+
+---
+## Functions in Strings
+
+### capitalize()
+
+The `capitalize()` method in Python is used to capitalize the first letter of a string.
+
+```python
+# Example
+'john doe'.capitalize()
+```
+
+### Output
+```plaintext
+'John doe'
+```
+
+### Explanation
+
+In this example, the `capitalize()` function capitalizes the first letter of the string, transforming 'john doe' into 'John doe'.
+
+### title()
+
+The `title()` method capitalizes the first letter of each word in a string.
+
+```python
+# Example
+'sneha sudam'.title()
+```
+
+### Output
+```plaintext
+'Sneha Sudam'
+```
+
+### Explanation
+
+The `title()` function capitalizes the first letter of each word in the string, resulting in 'Sneha Sudam'.
+
+### count(substring)
+
+The `count(substring)` method counts the occurrences of a substring in the string.
+
+```python
+# Example
+'pooja nikam'.count('ni')
+```
+
+### Output
+```plaintext
+2
+```
+
+### Explanation
+
+The `count()` function counts the occurrences of the substring 'ni' in the string, returning the value `2`.
+
+### replace(old, new)
+
+The `replace(old, new)` method replaces occurrences of the old substring with the new substring.
+
+```python
+# Example
+'Vicky Sharma'.replace('a', 'e')
+```
+
+### Output
+```plaintext
+'Vicky Sherme'
+```
+
+### Explanation
+
+The `replace()` function replaces occurrences of 'a' with 'e' in the string, resulting in 'Vicky Sherme'.
+
+### replace(old, new, count)
+
+The `replace(old, new, count)` method replaces a specified number of occurrences of the old substring with the new substring.
+
+```python
+# Example
+'Vicky Sharma'.replace('a', 'e', 1)
+```
+
+### Output
+```plaintext
+'Vicky Sherma'
+```
+
+### Explanation
+
+In this example, only the first occurrence of 'a' is replaced with 'e' in the string, resulting in 'Vicky Sherma'.
+
+
+### split(separator)
+
+The `split(separator)` method splits a string into a list of substrings based on the specified separator.
+
+```python
+# Example
+a = 'Aakar, Saurav, Kusum'
+print(a.split(','))
+```
+
+### Output
+```plaintext
+['Aakar', ' Saurav', ' Kusum']
+```
+
+### Explanation
+
+The `split()` function divides the string into a list of substrings based on the specified separator (`,` in this case), resulting in `['Aakar', ' Saurav', ' Kusum']`.
+
+```python
+# Example
+a = 'There——are—-many-—places——to——visit.'
+print(a.split('——'))
+```
+
+### Output
+```plaintext
+['There', 'are', 'many', 'places', 'to', 'visit.']
+```
+
+### Explanation
+
+The `split()` function divides the string using the specified separator (`'——'` in this case), resulting in `['There', 'are', 'many', 'places', 'to', 'visit.']`.
+
+### Print ASCII Letter
+
+This example takes user input and prints the ASCII values of each letter in the input string.
+
+```python
+# Example
+s = input()
+for char in s:
+ print(ord(char), end=' ')
+```
+
+### Output (for input 'hello')
+```plaintext
+104 101 108 108 111
+```
+
+### Explanation
+
+The `ord()` function is used to get the ASCII value of each character in the input string. The `end=' '` parameter ensures that the values are printed with a space in between.
+
+
+### Formatted Strings
+
+Formatted strings in Python provide a convenient way to embed variable values or expressions into a string, making it more readable and flexible.
+
+```python
+# Example
+name = 'Aakar'
+gender = 'Mate'
+age = 25
+print('Name:—', name, 'gender:—', gender, 'age:—', age)
+```
+
+### Output
+```plaintext
+Name:— Aakar gender:— Mate age:— 25
+```
+
+### Explanation
+
+In this example, a formatted string is created using the variables `name`, `gender`, and `age`, resulting in the output `Name:— Aakar gender:— Mate age:— 25`.
+
+There are several ways to achieve string formatting in Python, but one commonly used method involves the `format()` method.
+
+```python
+# Example
+template = 'Name:— {}, gender:— {}, age:— {}'
+print(template.format(name, gender, age))
+```
+
+### Output
+```plaintext
+Name:— Aakar, gender:— Mate, age:— 25
+```
+
+### Explanation
+
+The `format()` method is used to insert the values of `name`, `gender`, and `age` into the string template, resulting in the formatted output `Name:— Aakar, gender:— Mate, age:— 25`.
+
+```python
+# Example
+template = 'Name:— {0}, gender:— {1}, age:— {2}'
+print(template.format(name, gender, age))
+```
+
+### Output
+```plaintext
+Name:— Aakar, gender:— Mate, age:— 25
+```
+
+### Explanation
+
+In this example, positional placeholders `{0}`, `{1}`, and `{2}` are used in the template to indicate the positions of `name`, `gender`, and `age` in the `format()` method. The output is the same as the previous example.
+
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+a = 'Scaler Academy'
+print(a.count('a'))
+```
+
+**Choices**
+
+- [x] 2
+- [ ] 3
+- [ ] 4
+- [ ] 0
+
+The output of the given Python code will be 2. This is because the `count()` method is used to count the number of occurrences of a specified substring (in this case, the letter 'a') within the given string 'Scaler Academy'.
+
+
+---
+### Question
+
+What will be the output of the following?
+```python
+a = 'i-am-awesome'
+b = a.split('-')
+print(len(b))
+```
+
+**Choices**
+
+- [ ] 2
+- [x] 3
+- [ ] 4
+- [ ] 5
+
+
+
+The correct answer is 3. The code splits the string 'i-am-awesome' at each occurrence of the hyphen ('-') and creates a list `b` with three elements: ['i', 'am', 'awesome']. The `len(b)` then outputs 3, indicating the number of elements in the list.
\ No newline at end of file