All problems
› Counting problems
Counting problems
26 Counting DSA practice problems on CampusCode, each with statement, examples and constraints.
310. Count Occurrences of a Value in Linked List
Easy
Linked List
368. Segregate 0s, 1s, and 2s in a Linked List
Medium
Linked List
928. Count Words with Given Prefix in Trie
Medium
Trees
1270. Count Number of Set Bits (Hamming Weight)
Easy
Bit Manipulation
1316. Number of 1-Bits in All Numbers from 0 to N
Easy
Bit Manipulation
1317. Sum of Bit Differences Among All Pairs
Easy
Bit Manipulation
1318. Counting Bits — DP + Bit
Easy
Bit Manipulation
1323. Total Hamming Distance for All Pairs
Easy
Bit Manipulation
1332. Count of Pairs with AND Equal to Zero
Medium
Bit Manipulation
1336. Single Number II — Element Appears Three Times
Medium
Bit Manipulation
1343. Count Numbers with Unique Digits (Bitmask DP)
Medium
Bit Manipulation
1347. Count Strings Without Consecutive 1s
Medium
Bit Manipulation
1348. Number of Squareful Arrays (Bitmask)
Medium
Bit Manipulation
1351. Distribute Repeating Integers (Bitmask DP)
Medium
Bit Manipulation
1364. Largest Combination with Bitwise AND Greater Zero
Medium
Bit Manipulation
1381. Count All Valid Pickup Delivery Orders
Hard
Bit Manipulation
1382. Find Minimum Number of Coins for Each Amount
Hard
Bit Manipulation
1384. Count Ways to Assign Tasks — K Workers
Hard
Bit Manipulation
1388. Count Pairs with XOR in a Range
Hard
Bit Manipulation
1390. Sum of All XOR Triplets in Array
Hard
Bit Manipulation
1393. Count Total Set Bits in All Numbers 1 to N
Hard
Bit Manipulation
1395. Count Pairs with AND Greater Than XOR
Hard
Bit Manipulation
1397. Sum of XOR of All Subarrays
Hard
Bit Manipulation
1398. Count Subarrays with XOR Less Than K
Hard
Bit Manipulation
1404. Broken Necklace — Bitmask Circular DP
Hard
Bit Manipulation
1408. Count Arrays with XOR Equal to K (Linear Basis)
Hard
Bit Manipulation