May 2025
📦
Arrays
Challenge Instructions
Next, we will look at some array-based challenges
Some example projects are given below
- Linear search, bubble sort (IG & AS), binary search, insertion sort (A2)
- Non-syllabus sorting/searching algorithms - e.g. counting sort, quick sort, merge sort etc
- Count the number of times and item exists in an array
- Input 10 numbers into an array, then calculate the min/max/average/total/median/mode/standard deviation etc
- Find the closest integer to a search value in an array
- Reverse an array
- Find the second smallest number
- Count number of adjacent pairs - e.g. 3 and 4 are adjacent, but 3 and 5 aren't
- Count number of equal values in an array - e.g. [5, 8, 2] and [5, 4, 2] have 2 matching values at the corresponding index (5 and 2 at indexes 1 and 3 respectively)
- Find sequences that sum to n - e.g. [4,2,1,2,1,3] with a target sum of 6 would find the sequences 4,2 and 2,1,3
- Find missing numbers - assume array contains numbers in range 1-10 - you should output any numbers in this range that don't exist in
- Countdown game - given 6 numbers, output all the answers you can generate using the arithmetic operators: +-*/. Allow the user to specify a target number, then return true if that number can be made - i.e. a Countdown solver
...etc - there are many different examples you can think of
As a target, let's try and have 10 programs submitted by members of the community for others to look at...good luck...and have fun!
Top Submissions
Submission Instructions
Create your program on the editor page, then click the upload button at the bottom of the code editor as shown below
Once you are confident your program is working well without obvious bugs, then give it a relevant name, choose the current monthly challenge from the dropdown box, choose some program categories if you want and submit it :)
Note: your submitted programs will be in blue and you can overwrite them by opening them, clicking the upload button again and selecting "overwrite"