An open API service indexing awesome lists of open source software.

https://github.com/letsdeepchat/equality-in-array

Given an array of integers, determine the minimum number of elements to delete to leave only elements of equal value. Example arr= [1,2,2,3] Delete the 2 elements 1 and 3 leaving arr as [2,2]. If both twos plus either the 1 or the 3 are deleted, it takes 3 deletions to leave either [3] or [1]. The minimum number of deletions is . 2 Input Format The first line contains an integer n, the number of elements in arr. The next line contains n space-separated integers arr[i]. Constraints 0<n<=100 1<=arr[i]<=100 Sample Input 5 3 3 2 1 3
https://github.com/letsdeepchat/equality-in-array

Last synced: 2 months ago
JSON representation

Given an array of integers, determine the minimum number of elements to delete to leave only elements of equal value. Example arr= [1,2,2,3] Delete the 2 elements 1 and 3 leaving arr as [2,2]. If both twos plus either the 1 or the 3 are deleted, it takes 3 deletions to leave either [3] or [1]. The minimum number of deletions is . 2 Input Format The first line contains an integer n, the number of elements in arr. The next line contains n space-separated integers arr[i]. Constraints 0<n<=100 1<=arr[i]<=100 Sample Input 5 3 3 2 1 3

Awesome Lists containing this project

README

          

# Equality-in-Array
Given an array of integers, determine the minimum number of elements to delete to leave only elements of equal value. Example arr= [1,2,2,3] Delete the 2 elements 1 and 3 leaving arr as [2,2]. If both twos plus either the 1 or the 3 are deleted, it takes 3 deletions to leave either [3] or [1]. The minimum number of deletions is . 2 Input Format The first line contains an integer n, the number of elements in arr. The next line contains n space-separated integers arr[i]. Constraints 0<n<=100 1<=arr[i]<=100 Sample Input 5 3 3 2 1 3
# Equality-in-Array
Given an array of integers, determine the minimum number of elements to delete to leave only elements of equal value. Example arr= [1,2,2,3] Delete the 2 elements 1 and 3 leaving arr as [2,2]. If both twos plus either the 1 or the 3 are deleted, it takes 3 deletions to leave either [3] or [1]. The minimum number of deletions is . 2 Input Format The first line contains an integer n, the number of elements in arr. The next line contains n space-separated integers arr[i]. Constraints 0<n<=100 1<=arr[i]<=100 Sample Input 5 3 3 2 1 3
Equality in Array
Given an array of integers, determine the minimum number of elements to delete to leave only elements of equal value.

Example
arr= [1,2,2,3]

Delete the 2 elements 1 and 3 leaving arr as [2,2]. If both twos plus either the 1 or the 3 are deleted, it takes 3 deletions to leave either [3] or [1]. The minimum number of deletions is . 2

Input Format
The first line contains an integer n, the number of elements in arr. The next line contains n space-separated integers arr[i].

Constraints
0