GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 50DaysOfJavaScript/Day-45 at main · syedsohan/50DaysOfJavaScript

Expand file tree

/

Day-45

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

Day-45

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
findOutlier.js
findOutlier.js
 
 

README.md

Outline

Find The Parity Outlier.

Instructions

You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised of odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns this "outlier" N.

Examples

[2, 4, 0, 100, 4, 11, 2602, 36]

Should return: 11 (the only odd number).

[160, 3, 1719, 19, 11, 13, -21]

Should return: 160 (the only even number).

Challenges (0/3 done)

  • findOutlier([2,6,8,10,3]) should return 3.
  • findOutlier([0,0,3,0,0]) should return 3.
  • findOutlier([1,1,0,1,1]) should return 0.
function findOutlier(integers) {
  //your code here
}
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.