Counting Subarrays with Even Sum Using Prefix Sum Parity in C

Hard
28 views 23 Jan 2026
Count subarrays whose sum is an even number - How do you provide the mathematical logic to count combinations by tracking the parity (odd/even) of the prefix sum?...

Maximum Difference in Array with j > i (C Program)

Hard
4 views 23 Jan 2026
Finding the maximum difference of RR[j] - RR[i] where j > i - logic to update the max difference while tracking the minimum element?...

Equilibrium Index in an Array (C Program)

Hard
9 views 23 Jan 2026
Find equilibrium index in array where left sum = right sum - Approach to detect balance point by maintaining running sum?...

Finding the Smallest Subarray with Sum ≥ X Using Sliding Window in C

Hard
3 views 23 Jan 2026
Find the smallest subarray whose sum is greater than or equal to the given value - Two pointer sliding window expansion/shrink decision logic?...

Inversion Count in an Array (C Program)

Hard
2 views 23 Jan 2026
Inversion counting in an array (how many times the larger element comes before the smaller one) - logic for counting integrals using merge sort modification?...

Longest Subarray with Target Sum (C Program)

Hard
3 views 23 Jan 2026
Find the longest subarray whose sum is equal to a - Mechanism to find matching sums by prefix sum and hashmap it?...

Trapping Rainwater Using Left Max and Right Max Arrays in C

Hard
2 views 23 Jan 2026
Trapping Rainwater Problem - Logic to calculate water level at each position while maintaining left max and right max?...

Algorithm and C Program to Find Minimum Number of Swaps to Sort an Array

Hard
3 views 23 Jan 2026
Calculate minimum swaps to sort an array - mathematical approach to cycle detection and swap counting?...

Algorithm and C Program to Find an Element Appearing More Than n/2 Times

Hard
3 views 23 Jan 2026
Finding majority element in array that appears no/more than 2 times - How does the logic of count increment/decrement work while maintaining candidates?...

Maximum Subarray Sum Using Kadane’s Algorithm

Hard
3 views 23 Jan 2026
Find the subarray whose sum is maximum (Kadne's logic) - What is the intuition for resetting when the current sum is negative and why?...

Program to Find Leader Elements in an Array (C)

Medium
3 views 23 Jan 2026
Finding leader elements in an array (those greater than the subelements on their right side) - what is the logic behind scanning from right to left?...

Sliding Window Maximum Using Deque (C Program)

Medium
3 views 23 Jan 2026
Tracking the maximum element in a sliding window of size k - Efficient approach to updating the max as the window slides?...

Zig-Zag Array Arrangement Using Adjacent Swap (C Program)

Medium
3 views 23 Jan 2026
The array is to be arranged in a zig-zag pattern: small-large-small-large - condition to swap adjacent elements by adding them?...

Algorithm and C Program to Find Elements Greater Than Their Neighbors

Medium
5 views 23 Jan 2026
Finding packs in array (element greater than both of its neighbors) - different logic for boundary conditions and middle elements?...

Two Pointer Approach to Merge Sorted Arrays in C

Medium
3 views 23 Jan 2026
Merging two sorted arrays into a third sorted array - two pointer approach followed by comparison and selection logic?...

“Apply Conditional Discount on Products in an Array Using C”

Medium
3 views 23 Jan 2026
The array contains product precedences, you need to apply a discount: 10% on the first 5 items, 5% on the rest - how do you handle the conditional discount logic?...

“Find Maximum Consecutive 1s in a Binary Array in C”

Medium
3 views 23 Jan 2026
It's a binary array (0 and 1), you need to find the length of the maximum consecutive 1s - when will the counter reset logic be applied?...

“Access Next Element in a Circular Array Using Modulo Operator in C”

Medium
3 views 23 Jan 2026
How to access next element in circular array with wraparound - modelo operator trick of index calculation by doing that?...

“Find a Partition Point Where Two Parts Have Almost Equal Sum in an Array (C Program)”

Medium
2 views 23 Jan 2026
The array needs to be divided into two equal parts such that the sums of both parts are almost equal - what would be the strategy to find the partition point?...

“Find Differences of Adjacent Array Elements Using RR[i+1] − RR[i] Pattern in C”

Medium
3 views 23 Jan 2026
Array contains numbers, you need to find the difference of adjacent elements and store it in a new array - how will you implement the pattern RR[i+1] - RR[i]?...

“Convert Distances from Kilometers to Miles Using Array Traversal in C”

Easy
3 views 23 Jan 2026
An array containing distances stored in kilometers, needs to convert them all to miles (1 km = 0.621 miles) - systematic way to apply the formula?...

“Tracking Maximum Rainfall and Day from 30 Days Data in C”

Easy
2 views 23 Jan 2026
There is rainfall data of 30 days in array, find out on which day maximum rainfall occurred and what was that value-logic of tracking both maximum value and index?...

“Partition an Array into Even and Odd Numbers Using Two-Array Logic in C”

Medium
4 views 23 Jan 2026
I want to divide the array into two parts - the first half containing even numbers and the second half containing odd numbers - how do I approach the partitioning logic?...

“Check Lottery Winner Using Linear Search in C”

Easy
3 views 23 Jan 2026
There is an array of lottery numbers and the user entered his number, check whether he won or not - how will you implement the basic logic of linear search?...

“C Program to Calculate Affordable Items Within Budget”

Easy
5 views 23 Jan 2026
The array contains a number of items, the user needs to specify a budget and check how many items they can afford - the logic to maintain a running shoe?...

“Array Elements Equality Check Using First Element in C”

Medium
12 views 23 Jan 2026
There are some numbers in an array and you need to find out whether all the numbers are same or different - how do you design comparison logic from the first element?...

Array Out of Bounds in C (6 Subjects, 7th Marks Entered)

Easy
9 views 21 Jan 2026
Suppose a student has entered the marks for their six subjects into an array. What will happen if they accidentally enter the marks for a seventh subject as well? Will the program crash, or something ...

Partial Array Initialization in C: Remaining Elements Me Kya Value Aata Hai?

Easy
5 views 21 Jan 2026
When initializing an array, if I write `int arr[5] = {10, 20, 30}`, what values ​​will be stored in the remaining two elements, and how does the compiler handle this?...

Store Salaries of 100 Employees (Variables vs Array) in C

Easy
3 views 21 Jan 2026
If I want to store the salaries of 100 employees in my program, should I create 100 separate variables or use an array? What problems might arise with each approach?...

C Array Memory Storage and Address Calculation

Easy
3 views 21 Jan 2026
When we declare an array in C language, such as int numbers[10],
how exactly is it stored in memory, and how does each element get its memory address?...