Counting DSA Problems

174 counting problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 174: 58 easy, 18 medium and 24 hard. Practise them free on InternHack and track what you have solved.

Counting problems, easiest first

  1. Best Poker Hand (Easy)
  2. Check if All Characters Have Equal Number of Occurrences (Easy)
  3. Check if Number Has Equal Digit Count and Digit Value (Easy)
  4. Check if One String Swap Can Make Strings Equal (Easy)
  5. Check Whether Two Strings are Almost Equivalent (Easy)
  6. Count Common Words With One Occurrence (Easy)
  7. Count Elements With Maximum Frequency (Easy)
  8. Count Elements With Strictly Smaller and Greater Elements (Easy)
  9. Count Largest Group (Easy)
  10. Count Number of Pairs With Absolute Difference K (Easy)
  11. Count Pairs Of Similar Strings (Easy)
  12. Count Pairs That Form a Complete Day I (Easy)
  13. Count Tested Devices After Test Operations (Easy)
  14. Count the Number of Consistent Strings (Easy)
  15. Count the Number of Vowel Strings in Range (Easy)
  16. Design Parking System (Easy)
  17. Determine if String Halves Are Alike (Easy)
  18. Divide Array Into Equal Pairs (Easy)
  19. Filter Characters by Frequency (Easy)
  20. Find Lucky Integer in an Array (Easy)
  21. Find Most Frequent Vowel and Consonant (Easy)
  22. Find The Least Frequent Digit (Easy)
  23. Find the Number of Winning Players (Easy)
  24. Find Valid Pair of Adjacent Digits in String (Easy)
  25. Find Words That Can Be Formed by Characters (Easy)
  26. First Letter to Appear Twice (Easy)
  27. First Unique Character in a String (Easy)
  28. Furthest Point From Origin (Easy)
  29. Increasing Decreasing String (Easy)
  30. Intersection of Multiple Arrays (Easy)
  31. Intersection of Three Sorted Arrays (Easy)
  32. Kth Distinct String in an Array (Easy)
  33. Longest Harmonious Subsequence (Easy)
  34. Majority Element (Easy)
  35. Maximum Count of Positive Integer and Negative Integer (Easy)
  36. Maximum Difference Between Even and Odd Frequency I (Easy)
  37. Maximum Number of Balloons (Easy)
  38. Maximum Number of Balls in a Box (Easy)
  39. Maximum Number of Pairs in Array (Easy)
  40. Maximum Population Year (Easy)
  41. Minimum Deletions for At Most K Distinct Characters (Easy)
  42. Most Common Word (Easy)
  43. Most Frequent Even Element (Easy)
  44. Most Frequent Number Following Key In an Array (Easy)
  45. Number of Equivalent Domino Pairs (Easy)
  46. Number of Good Pairs (Easy)
  47. Ransom Note (Easy)
  48. Rearrange Characters to Make Target String (Easy)
  49. Redistribute Characters to Make All Strings Equal (Easy)
  50. Remove Letter To Equalize Frequency (Easy)
  51. Sort Integers by The Number of 1 Bits (Easy)
  52. Split a String in Balanced Strings (Easy)
  53. Split the Array (Easy)
  54. Substrings of Size Three with Distinct Characters (Easy)
  55. Sum of Unique Elements (Easy)
  56. Transform Array by Parity (Easy)
  57. Uncommon Words from Two Sentences (Easy)
  58. X of a Kind in a Deck of Cards (Easy)
  59. 3Sum With Multiplicity (Medium)
  60. Apply Operations to Make String Empty (Medium)
  61. Better Compression of String (Medium)
  62. Bulls and Cows (Medium)
  63. Change Minimum Characters to Satisfy One of Three Conditions (Medium)
  64. Check If Array Pairs Are Divisible by k (Medium)
  65. Check If Two Expression Trees are Equivalent (Medium)
  66. Construct K Palindrome Strings (Medium)
  67. Construct String With Repeat Limit (Medium)
  68. Count Almost Equal Pairs I (Medium)
  69. Count Caesar Cipher Pairs (Medium)
  70. Count Nice Pairs in an Array (Medium)
  71. Count Number of Bad Pairs (Medium)
  72. Count Number of Distinct Integers After Reverse Operations (Medium)
  73. Count Pairs That Form a Complete Day II (Medium)
  74. Count Servers that Communicate (Medium)
  75. Count Special Triplets (Medium)
  76. Count the Number of Good Subsequences (Medium)
  77. Count Anagrams (Hard)
  78. Count Array Pairs Divisible by K (Hard)
  79. Count Pairs Of Nodes (Hard)
  80. Distribute Repeating Integers (Hard)
  81. Divide Array Into Increasing Sequences (Hard)
  82. Largest Color Value in a Directed Graph (Hard)
  83. Longest Subsequence Repeated k Times (Hard)
  84. Make the XOR of All Segments Equal to Zero (Hard)
  85. Maximum Number of Ways to Partition an Array (Hard)
  86. Maximum Score Words Formed by Letters (Hard)
  87. Minimum Cost to Split an Array (Hard)
  88. Minimum Number of Operations to Make String Sorted (Hard)
  89. Minimum Operations to Make Character Frequencies Equal (Hard)
  90. Minimum Swaps to Avoid Forbidden Values (Hard)
  91. Minimum Total Cost to Make Arrays Unequal (Hard)
  92. Number of Different Subsequences GCDs (Hard)
  93. Rearrange String k Distance Apart (Hard)
  94. Sorted GCD Pair Queries (Hard)
  95. Subarrays with K Different Integers (Hard)
  96. Sum of Perfect Square Ancestors (Hard)
  97. Sum of Prefix Scores of Strings (Hard)
  98. The Number of Good Subsets (Hard)
  99. Threshold Majority Queries (Hard)
  100. Total Characters in String After Transformations II (Hard)

Companies that ask counting problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics