root Posted November 10, 2022 Share Posted November 10, 2022 In this thread: anyone can share a programming problem and we will post solutions. The goal is to find solutions with impressive characteristics such as performance or brevity. This can be interpreted as recreational optimization or code golf. Your first question (I will provide an example answer if there are no biters): How would you locate gaps in a list of integers? Example use case: determining which IDs have been deleted from a database Example input: [1,3,4,5,8,9] Example output: [2,6,7] (Yes, this does not detect gaps at the tail of the list.) Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now