/category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

  • Contains category wise organized problems(data structures, competitive) of popular platforms.
  • not only solution but also
    • approaches
    • corner cases
    • special notes if any
    • similar questions if encountered.

categories

  1. JMI college placement
  2. adhoc implementation
  3. Greedy
  4. 2 Pointers
  5. Dynamic Programming
    1. knapsack type
    2. Coin Change type
    3. Grid path type
    4. LIS type
    5. Fibonacci type
    6. Prefix Sums / 1D Range sum type / Cumulative sums
  6. Graphs
    1. General implementation
    2. Topological sorting
    3. Shortest Path
    4. flood fill
    5. DFS
    6. BFS
    7. 01 BFS
    8. MSSP
    9. MST
    10. Tree + dp
  7. Number Theory
  8. Searching and sorting
    1. implementation type
    2. sorting and observation type
    3. Binary Search type
    4. Two pointers
    5. Heap type
    6. Intervals type
    7. Divide and Conquer
  9. Data structure
    1. Stack
    2. DSU
    3. Linked List
    4. Trees
    5. Binary Search Trees
    6. Trie, prefix tree
  10. Bitset
  11. Cracking the interview Questions

category wise

JMI

  1. company data 2020
  2. company data 2021
  3. Sapient
  4. Delhivery
  5. Infoedge
  6. JTG_
  7. Innovacer
  8. Optum
  9. Accenture
  10. Wiley Mthree
  11. Mobikwik
  12. Samsung

Adhoc implementation

  1. Caesar Cipher
  2. Polycarp and String Transformation
  3. Vitamins
  4. Divide and print
  5. Gas station
  6. majority element
  7. majority element 2
  8. move zeros
  9. sort integers by power
  10. Kill the Monsters
  11. Partition String
  12. valid palindrome II

Greedy

  1. Best time to sell the stock

Dynamic Programming.

Fibonacci-type

  1. typical stairs
  2. boredom
  3. Constanze's Machine
  4. Basketball
  5. domino and tromino tiling
  6. House robber
  7. Delete and earn
  8. 746. Min Cost Climbing Stairs
  9. 413. Arithmetic Slices

Knapsack type

  1. two sets2
  2. book shop
  3. money sums
  4. dividing coins
  5. divisible group sums
  6. wedding shopping
  7. sum of different_primes
  8. hoof paper scissor
  9. maximum score from performing multiplication operations
  10. Divide the array in K segments such that the sum of minimums is maximized
  11. 188. Best Time to Buy and Sell Stock IV
  12. Best Time to Buy and Sell Stock with Cooldown
  13. 714. Best Time to Buy and Sell Stock with Transaction Fee
  14. 516. Longest Palindromic Subsequence

Coin change type

  1. removing_digits
  2. dollars
  3. fruit feast
  4. Minimum Difficulty of a Job Schedule
  5. 1155. Number of Dice Rolls With Target Sum
  6. 188. Best Time to Buy and Sell Stock IV
  7. 714. Best Time to Buy and Sell Stock with Transaction Fee
  8. 309. Best Time to Buy and Sell Stock with Cooldown

Counting DP type

  1. Coin change 2
  2. 91. Decode Ways

Grid path types

  1. edit distance
  2. grid paths
  3. LCS
  4. Maximal square
  5. Unique Paths
  6. Unique Paths 2
  7. Minimum Path sum
  8. 931. Minimum Falling Path Sum
  9. 718. Maximum Length of Repeated Subarray
  10. 799. Champagne Tower

LIS type

  1. what goes up
  2. kth increasing
  3. 139. Word Break

1D Range sum

  1. Maximum Absolute Sum of Any Subarray
  2. maximum product subarray
  3. Number of Smooth Descent Periods of a Stock
  4. blackboard gcd
  5. make power of 2
  6. Subsequence summing to 7
  7. Good days to rob the bank
  8. and it's non-zero
  9. contiguous array
  10. Tsundoku.md
  11. Intervals Between Identical Elements
  12. Maximum Sum of Two Non-Overlapping Subarrays
  13. Reducing dishes
  14. Best time to Buy and sell stocks
  15. 1590. Make Sum Divisible by P
  16. 413. Arithmetic Slices
  17. Count of subarrays having sum equal to its length
  18. Number of subarrays having absolute sum greater than K

TODO

  1. aab
  2. cooking
  3. fg operation
  4. shipping center
  5. strange lunchbox

Graphs

General implementation

  1. Detonate the maximum bombs
  2. Replace the numbers
  3. Moocast

Topological Sorting

  1. course schedule
  2. game routes
  3. longest flight route
  4. Parallel course 3
  5. Restricted permutation
  6. G - Longest Path
  7. Gardner and trees
  8. minimum height tree
  9. Find All Possible Recipes from Given Supplies

Shortest path

  1. flight discount
  2. investigation
  3. djikstra
  4. network delay time
  5. 8 puzzle on graph
  6. swim in the rising water

Flood fill

  1. making a large island
  2. Number of islands

DFS

  1. round trip
  2. Kings Path
  3. Neighbours
  4. Keys and rooms

BFS

  1. graph girth
  2. word ladder
  3. Making a large island
  4. swim in the rising water
  5. Multiply and rotate
  6. Keys and rooms

01 BFS

  1. Wizard in maze

MSSP

  1. 01 Matrix
  2. Shortest distance to a character

MST

  1. 3-types
  2. minimum cost to connect path

tree dp

  1. 1519. Number of Nodes in the Sub-Tree With the Same Label

Number theory

  1. Amusement park
  2. Divisor counts
  3. Pairs of Songs With Total Durations Divisible by 60
  4. max GCD pair
  5. make it equal
  6. count nice pairs in an array
  7. robbery
  8. Max GCD 2
  9. Multiple length

Searching and sorting

greedy implementation

  1. Shortest distance to a character

sorting and observation

  1. Linear approximation
  2. LR Insertion

Binary search type

  1. Apartments
  2. Subarray sums 2
  3. binary search in sorted array
  4. Koko eating bananas
  5. swim in the rising water
  6. count the words after adding a letter

Two Pointers

  1. maximum consecutive one's
  2. Longest X
  3. Subarrays with k different Integers
  4. Number of Substrings Containing All Three Characters
  5. binary Subarrays with sum
  6. 2134. Minimum Swaps to Group All 1's Together II
  7. 438. Find All Anagrams in a String
  8. 567. Permutation in String

Intervals type

  1. non overlapping subintervals
  2. Merge intervals
  3. Car pooling
  4. 567. Permutation in String

Heaps

  1. Top k frequent words
  2. 215. Kth Largest Element in an Array
  3. 347. Top K Frequent Elements
  4. 1046. Last Stone Weight
  5. 973. K Closest Points to Origin
  6. 1642. Furthest Building You Can Reach, todo
  7. 295. Find Median from Data Stream , todo

divide and conquer

  1. Thanos sort

Data structure

Stack

  1. Longest valid paranthesis
  2. Asteroid Collision

DSU

  1. Little Alawn's Puzzle
  2. Graph destruction
  3. Accounts Merge
  4. Neighbours
  5. Largest Component Size by Common Factor
  6. Making a large island
  7. Most Stones Removed with Same Row or Column
  8. smallest string with swaps

Linked-list

  1. add two numbers
  2. delete node in linked list
  3. intersection of two linked list
  4. linked list cycle
  5. middle of the linked list
  6. reverse linked list
  7. Odd Even Linked List
  8. Palindrome linked list
  9. 23. Merge k sorted list
  10. LR Insertion

Trees

  1. Preorder Traversal
  2. Inorder Traversal
  3. Postorder Traversal
  4. Level order
  5. left view
  6. right view
  7. top view
  8. bottom view
  9. Depth of binary tree
  10. Balanced binary tree
  11. Same Tree
  12. diameter of the binary tree
  13. binary tree tilt
  14. Populating Next Right Pointers in Each Node
  15. Lowest common ancestor
  16. Maximum difference between node and ancestor
  17. vertical order traversal
  18. 103. Binary Tree Zigzag Level Order Traversal
  19. 101. Symmetric Tree
  20. 662. Maximum Width of Binary Tree
  21. 222. Count Complete Tree Nodes
  22. 2196. Create Binary Tree From Descriptions

BST

  1. insert into binary search tree
  2. 98. Validate Binary Search Tree
  3. 108. Convert Sorted Array to Binary Search Tree
  4. 783. Minimum Distance Between BST Nodes

trie

  1. Implement Trie (Prefix Tree)
  2. Design Add and Search Words Data Structure

bitset

  1. complement of base 10
  2. Hammering distance
  3. Number of valid words for each puzzle
  4. Total hammering distance
  5. and it's non-zero
  6. Make it equal
  7. count the words after adding a letter
  8. majority element
  9. Find XOR Sum of All Pairs Bitwise AND

Cracking Interview

  1. Is unique
  2. Check Permutation

Please follow these rules, if you wish to CONTRIBUTE.

Current repo Structure.

ROOT
  |
  Platform_1
  |
  |___ Topic/Tag
  .      |____ problem_name/README.md
  .      |____ problem_name/README.md
  .      |____ problem_name/README.md
  .
  .
  |
  Platform_2
  |
  |___ Topic/Tag
         |____ problem_name/README.md

Structure of ProblemList.md

Topic on which problem is base (preferrably h2, h3 heading)

Problem name, Easy / medium / hard (according to you)

- What makes it Easy/medium/hard according to you.
    |_____ point 1
    |_____ point 2

- some key points, was there some different approach then regular?
    |_____ point 1
    |_____ point 2

- Appraoch (should be insightfull)

- corner cases, if you faced any
    |_____ point 1
    |_____ point 2

- code(it is advisable to copy RAW of similar problem on this repo, to save time)

- Similar problem if you encounter any.

Some Templates you may inspire from

to save time you can copy the template by viewing RAW file and fit in your content.