Shivi_Aggarwal
Shivi_Aggarwal
  1. A Program to check if strings are rotations of each other or not
  2. Position of rightmost set bit
  3. Find the Number Occurring Odd Number of Times
  4. Minimum number of jumps to reach end
  5. Median of two sorted arrays of same size
  6. Leaders in an array
  7. Segregate 0s and 1s in an array
  8. Find whether a given number is a power of 4 or not
  9. Find the two repeating elements in a given array
  10. Sort an array of 0s, 1s and 2s
  11. Find the repeating and the missing | Added 3 new methods
  12. Find the smallest missing number
  13. Find whether an array is subset of another array | Added Method 3
  14. Find the minimum distance between two numbers
  15. Longest Common Subsequence | DP-4
  16. Edit Distance | DP-5
  17. Matrix Chain Multiplication | DP-8
  18. Binomial Coefficient | DP-9
  19. Largest subarray with equal number of 0s and 1s
  20. Binary representation of a given number
  21. Maximum Product Cutting | DP-36
  22. Count all distinct pairs with difference equal to k
  23. Swap two nibbles in a byte
  24. Length of the largest subarray with contiguous elements | Set 1
  25. Longest Even Length Substring such that Sum of First and Second Half is same
  26. Count number of ways to reach a given score in a game
  27. Find the point where maximum intervals overlap
  28. Find a pair with maximum product in array of Integers
  29. Validity of a given Tic-Tac-Toe board configuration
  30. Count even length binary sequences with same sum of first and second half bits
  31. Given a Boolean Matrix, find k such that all elements in k'th row are 0 and k'th column are 1.
  32. Submatrix Sum Queries
  33. Check whether given degrees of vertices represent a Graph or Tree
  34. Find even occurring elements in an array of limited range
  35. Multiples of 3 or 7
  36. Count pairs whose products exist in array
  37. Program for FCFS CPU Scheduling | Set 1
  38. Check if two arrays are equal or not
  39. Largest permutation after at most k swaps
  40. Circular Matrix (Construct a matrix with numbers 1 to m*n in spiral way)
  41. Multiply large integers under large modulo
  42. HeapSort
  43. Program to print a pattern of numbers
  44. Program to find largest element in an array
  45. Program to multiply two matrices
  46. Program for factorial of a number
  47. Program to find transpose of a matrix
  48. Program for addition of two matrices
  49. Program for subtraction of matrices
  50. Recursive program to linearly search an element in a given array
  51. Program to check if two given matrices are identical
  52. Check if a sorted array can be divided in pairs whose sum is k
  53. Count numbers whose sum with x is equal to XOR with x
  54. Sum of product of all pairs of array elements
  55. Maximum Length Bitonic Subarray | Set 2 (O(n) time and O(1) Space)
  56. Program to print Lower triangular and Upper triangular matrix of an array
  57. Count total number of digits from 1 to n
  58. Print triplets with sum less than or equal to k
  59. Print matrix after applying increment operations in M ranges
  60. Maximum Weight Difference
  61. Frequency of a string in an array of strings
  62. Greatest divisor which divides all natural number in range [L, R]
  63. Longest increasing subarray
  64. Number of steps required to convert a binary number to one
  65. Check if it is possible to reach vector B by rotating vector A and adding vector C to it
  66. Highest Response Ratio Next (HRRN) CPU Scheduling
  67. Printing string in plus ‘+’ pattern in the matrix
  68. Mirror of matrix across diagonal
  69. Ways of filling matrix such that product of all rows and all columns are equal to unity
  70. Program to swap upper diagonal elements with lower diagonal elements of matrix.
  71. Find smallest subarray that contains all elements in same order
  72. Find largest prime factor of a number
  73. Area of a square from diagonal length
  74. Count pairs from two sorted matrices with given sum
  75. Sum over Subsets | Dynamic Programming
  76. Print lower triangular matrix pattern from given array
  77. Number of subarrays with m odd numbers
  78. Maximum Perimeter Triangle from array
  79. Program to check if first and the last characters of string are equal
  80. Number of prefix sum prime in given range query
  81. Find duplicate in an array in O(n) and by using O(1) extra space
  82. Count pairs in an array which have at least one digit common
  83. Flag register of 8086 microprocessor
  84. Sorting array with reverse around middle
  85. Area of the circumcircle of any triangles with sides given
  86. Make array elements equal in Minimum Steps
  87. Check if a string has m consecutive 1's or 0's
  88. Find the number of operations required to make all array elements Equal
  89. Print all triplets with given sum
  90. Find an element which divides the array in two subarrays with equal product
  91. Degree of a Cycle Graph
  92. Maximum number by concatenating every element in a rotation of an array
  93. Memoization (1D, 2D and 3D)
  94. Previous greater element
  95. Check if concatenation of two strings is balanced or not
  96. String transformation using XOR and OR
  97. Sudo Placement[1.5] | Second Smallest in Range
  98. Find the only missing number in a sorted array
  99. Minimum cost to reach the top of the floor by climbing stairs
  100. Longest Subarray with first element greater than or equal to Last element
  101. Minimum number of single digit primes required whose sum is equal to N
  102. Program to find last two digits of 2^n
  103. Sum of two numbers modulo M
  104. Surd number
  105. Count pairs with Bitwise AND as ODD number
  106. Count ways to distribute m items among n people
  107. Check if a key is present in every segment of size k in an array
  108. Delete array element in given index range [L - R]
  109. Number of handshakes such that a person shakes hands only once
  110. Sum of the numbers upto N that are divisible by 2 or 5
  111. Maximum profit after buying and selling the stocks
  112. Number of chocolates left after k iterations
  113. Number of ways to change the XOR of two numbers by swapping the bits
  114. Minimum element in a max heap
  115. Length of longest consecutive zeroes in the binary representation of a number.
  116. Sum of bitwise OR of all subarrays
  117. Program to check whether 4 points in a 3-D plane are Coplanar
  118. Count number of triplets with product equal to given number with duplicates allowed
  119. Pairs with GCD equal to one in the given range
  120. Number of divisors of a given number N which are divisible by K
  121. Find Nth term of the series 3, 14, 39, 84...
  122. Find area of parallelogram if vectors of two adjacent sides are given
  123. Minimum time required to complete a work by N persons together
  124. Check if subarray with given product exists in an array
  125. Smallest power of 2 which is greater than or equal to sum of array elements
  126. Program to calculate Bitonicity of an Array
  127. Find the Initial Array from given array after range sum queries
  128. Maximize the product of four factors of a Number
  129. Longest Subarray with Sum greater than Equal to Zero
  130. Minimum Players required to win the game
  131. Program to find total number of edges in a Complete Graph
  132. Sum of Digits in a^n till a single digit
  133. Find any pair with given GCD and LCM
  134. Find bitwise AND (&) of all possible sub-arrays
  135. Largest square that can be inscribed in a semicircle
  136. Largest triangle that can be inscribed in an ellipse
  137. Program to print elements of a Matrix row-wise skipping alternate elements
  138. Program to find the Volume of an irregular tetrahedron
  139. Find sum of product of number in given series
  140. Ratio of mth and nth terms of an A. P. with given ratio of sums
  141. Program to find Circuit Rank of an Undirected Graph
  142. Split the number into N parts such that difference between the smallest and the largest part is minimum
  143. Check if a point is inside, outside or on the ellipse
  144. Count number of integers less than or equal to N which has exactly 9 divisors
  145. Find the count of maximum contiguous Even numbers
  146. Program to convert KiloBytes to Bytes and Bits
  147. Maximum Sum of Products of Two Arrays
  148. Set the rightmost off bit
  149. Total number of different staircase that can made from N boxes
  150. Program to find the Nth Harmonic Number
  151. Program to find the Radius of the incircle of the triangle
  152. Count Numbers with N digits which consists of odd number of 0's
  153. Circumradius of the rectangle
  154. Check n^2 - m^2 is prime or not
  155. Given a number x , find y such that x*y + 1 is not a prime
  156. Absolute difference between sum and product of roots of a quartic equation
  157. Maximum removal from array when removal time >= waiting time
  158. Sum of nth terms of Modified Fibonacci series made by every pair of two arrays
  159. Find the number of rectangles of size 2*1 which can be placed inside a rectangle of size n*m
  160. Product of all the elements in an array divisible by a given number K
  161. Smallest Integer to be inserted to have equal sums
  162. Sum of lengths of all 12 edges of any rectangular parallelepiped
  163. Count all the numbers in a range with smallest factor as K
  164. Program to print the pattern with two hollow Triangles
  165. Print N lines of 4 numbers such that every pair among 4 numbers has a GCD K
  166. Minimum increment operations to make the array in increasing order
  167. Check if a large number is divisible by 2, 3 and 5 or not
  168. Sum of Fibonacci Numbers with alternate negatives
  169. Find Sum of Series 1^2 - 2^2 + 3^2 - 4^2 ..... upto n terms
  170. Product of all pairwise consecutive elements in an Array
  171. Check if suffix and prefix of a string are palindromes
  172. Number of groups of magnets formed from N magnets
  173. Check if a string is the typed name of the given name
  174. Find length of Diagonal of Hexagon
  175. Length of the Diagonal of the Octagon
  176. Check if the characters of a given string are in alphabetical order
  177. Largest element in the array that is repeated exactly k times
  178. Find if a molecule can be formed from 3 atoms using their valence numbers
  179. Rearrange all elements of array which are multiples of x in increasing order
  180. Check if it is possible to rearrange a binary string with alternate 0s and 1s
  181. Program to find count of numbers having odd number of divisors in given range
  182. Minimum number of operations required to delete all elements of the array
  183. Longest subarray with elements having equal modulo K
  184. Minimum steps to remove substring 010 from a binary string
  185. Count the number of vowels occurring in all the substrings of given string
  186. Find if array has an element whose value is half of array sum
  187. Probability of getting two consecutive heads after choosing a random coin among two different types of coins
  188. Check if a prime number can be expressed as sum of two Prime Numbers
  189. Print a case where the given sorting algorithm fails
  190. Minimum numbers (smaller than or equal to N) with sum S
  191. Largest right circular cone that can be inscribed within a sphere
  192. Largest cone that can be inscribed within a cube
  193. Largest cube that can be inscribed within a right circular cone
  194. Overall percentage change from successive changes
  195. Count pairs with Bitwise XOR as EVEN number
  196. Program to convert the diagonal elements of the matrix to 0
  197. Sum of elements whose square root is present in the array
  198. Replace every element of the array by its next element
  199. Print numbers in descending order along with their frequencies
  200. Replace the middle element of matrix with sum of surrounding elements
  201. Expressing a fraction as a natural number under modulo 'm'
  202. Area of Circumcircle of a Right Angled Triangle
  203. Larger of a^b or b^a (a raised to power b or b raised to power a)
  204. Find the element whose multiplication with -1 makes array sum 0
  205. Check if the given decimal number has 0 and 1 digits only
  206. Largest Divisor of a Number not divisible by a perfect square
  207. Summing the sum series
  208. Count the number of special permutations
  209. Find elements of array using XOR of consecutive elements
  210. Count pairs in an array that hold i+j= arr[i]+arr[j]
  211. Count numbers in a range that are divisible by all array elements
  212. Check if N is Strong Prime
  213. Remove exactly one element from the array such that max - min is minimum
  214. Apothem of a n-sided regular polygon
  215. Find the repeating and the missing number using two equations
  216. Count rows in a matrix that consist of same element
  217. Largest number less than X having at most K set bits
  218. Minimum number of sets with numbers less than Y
  219. Find cost price from given selling price and profit or loss percentage
  220. Find the non decreasing order array from given array
  221. First and Last Three Bits
  222. Smallest perfect Cube divisible by all elements of an array
  223. Maximum length subarray with LCM equal to product
  224. Program to find sum of harmonic series
  225. Reverse Middle X Characters
  226. Check if the binary representation of a number has equal number of 0s and 1s in blocks
  227. Count of values of x <= n for which (n XOR x) = (n - x)
  228. Largest right circular cone that can be inscribed within a sphere which is inscribed within a cube
  229. Count of sub-strings that are divisible by K
  230. Composite XOR and Coprime AND
  231. Check if possible to shuffle a matrix with adjacent movements
  232. Minimum positive integer divisible by C and is not in range [A, B]
  233. Maximum GCD from Given Product of Unknowns
  234. Count operations of the given type required to reduce N to 0
  235. Arrange first N natural numbers such that absolute difference between all adjacent elements > 1
  236. Number of Simple Graph with N Vertices and M Edges
  237. Minimum operations required to make all the array elements equal