0% found this document useful (0 votes)
6 views

arrays

The document outlines various programming challenges related to arrays and lists, including tasks such as counting pairs, summing integers, and finding minimum distances. Each challenge requires specific algorithms to solve problems like counting subarrays, maximizing luck, and determining unique elements. The challenges emphasize different aspects of data manipulation and algorithm design.

Uploaded by

buchannolacharan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

arrays

The document outlines various programming challenges related to arrays and lists, including tasks such as counting pairs, summing integers, and finding minimum distances. Each challenge requires specific algorithms to solve problems like counting subarrays, maximizing luck, and determining unique elements. The challenges emphasize different aspects of data manipulation and algorithm design.

Uploaded by

buchannolacharan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Arrays and Lists

Sales by Match – Count matching pairs of socks using a frequency map.

Simple Array Sum – Return the sum of all integers in the array.

Subarray Division – Count subarrays of length m with sum equal to d.

Migratory Birds – Find the bird type seen most often; prefer the smallest ID on a tie.

Diagonal Difference – Calculate absolute difference between diagonals of a square matrix.

Birthday Cake Candles – Count how many candles are the tallest.

Divisible Sum Pairs – Count pairs whose sum is divisible by a given number k.

Mini-Max Sum – Print the min and max sum of n-1 integers from a list.

Counting Valleys – Count valleys traversed based on up/down steps from sea level.

Equalize the Array – Find the minimum deletions required to make all elements equal.
Minimum Distances – Find minimum distance between equal elements in the array.

Beautiful Triplets – Count triplets where each element is separated by a fixed difference.

Picking Numbers – Find max length subarray with elements differing by ≤ 1.

Repeated String – Count 'a's in infinitely repeated string up to n characters.

Service Lane – For a given range, find the minimum width in the service lane.

Lonely Integer – Return the unique element that doesn’t have a duplicate.

Luck Balance – Maximize luck by losing up to k important contests.

Jumping on the Clouds – Find minimum jumps to reach the last cloud avoiding thunderclouds.

Chocolate Feast – Calculate total chocolates including from wrapper exchanges.

Counting Sort 1/2 – Perform counting sort using frequency counts.

Mark and Toys – Buy maximum toys without exceeding the budget.
Closest Numbers – Find all pairs with the smallest absolute difference.

Find the Median – Return the median of a sorted list.

Climbing the Leaderboard – Assign ranks to player scores using dense ranking.

Max Min – Find minimum difference between any k elements in a sorted array.

Gaming Array – Determine the winner by simulating the removal of largest elements.

You might also like