6 kyu

Odder than the rest

139 of 315JohanWiltink

Description:

Integral numbers can be even or odd.

Even numbers satisfy n = 2m ( with m also integral ) and we will ( completely arbitrarily ) think of odd numbers as n = 2m + 1.
Now, some odd numbers can be more odd than others: when for some n, m is more odd than for another's. Recursively. :]
Even numbers are just not odd.

Task

Given a finite list of integral ( not necessarily non-negative ) numbers, determine the number that is odder than the rest.
If there is no single such number, no number is odder than the rest; return Nothing, null or a similar empty value.

Examples

oddest [1,2] -> Just 1
oddest [1,3] -> Just 3
oddest [1,5] -> Nothing
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => null
{ 1 2 } oddest -> 1
{ 1 3 } oddest -> 3
{ 1 5 } oddest -> f
oddest([1, 2]) => 1
oddest([1, 3]) => 3
oddest([1, 5]) => nothing
Kata.Oddest(new int[] { 1, 2 }) => 1
Kata.Oddest(new int[] { 1, 3 }) => 3
Kata.Oddest(new int[] { 1, 5 }) => null
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => null
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => null
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => nil
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => null
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => nil
oddest([1,2]) => 1
oddest([1,3]) => 3
oddest([1,5]) => None
oddest [1,2] -> Some 1
oddest [1,3] -> Some 3
oddest [1,5] -> None

Hint

Click here. How odd is -1 ?
Puzzles
Algorithms
Recursion

Stats:

CreatedSep 3, 2019
PublishedSep 3, 2019
Warriors Trained2176
Total Skips163
Total Code Submissions6586
Total Times Completed315
Haskell Completions19
JavaScript Completions92
Python Completions139
Crystal Completions3
CoffeeScript Completions7
Ruby Completions21
TypeScript Completions19
Dart Completions33
Julia Completions8
C# Completions29
Factor Completions10
λ Calculus Completions1
Total Stars27
% of votes with a positive feedback rating77% of 88
Total "Very Satisfied" Votes60
Total "Somewhat Satisfied" Votes16
Total "Not Satisfied" Votes12
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • JohanWiltink Avatar
  • hobovsky Avatar
  • user8436785 Avatar
  • Kacarott Avatar
  • saudiGuy Avatar
Ad