Coding Challenge: Government Forms

Let's write a program to input forms and return the names of those forms which end with "cy".

Problem statement

Complete the following program to compute and return the names of political forms ending with "cy".

Input

const governmentForms = [{
	name: "Plutocracy",
	definition: "Rule by the wealthy"
},
{
	name: "Oligarchy",
	definition: "Rule by a small number of people"
},
{
	name: "Kleptocracy",
	definition: "Rule by the thieves"
},
{
	name: "Theocracy",
	definition: "Rule by a religious elite"
},
{
	name: "Democracy",
	definition: "Rule by the people"
},
{
	name: "Autocracy",
	definition: "Rule by a single person"
}];

Expected output

[Plutocracy,Kleptocracy,Theocracy,Democracy,Autocracy]

Coding exercise

Get hands-on with 1200+ tech skills courses.