kyu_7.sort_out_the_men_from_boys package¶
Submodules¶
kyu_7.sort_out_the_men_from_boys.men_from_boys module¶
-
kyu_7.sort_out_the_men_from_boys.men_from_boys.
men_from_boys
(arr: List[int]) → list[source]¶ Sort out the men from the boys.
Men are the Even numbers and Boys are the odd.
Return an array/list where Even numbers come first then odds.
Since, Men are stronger than Boys, then Even numbers in ascending order while odds in descending. :param arr: :return:
kyu_7.sort_out_the_men_from_boys.test_men_from_boys module¶
-
class
kyu_7.sort_out_the_men_from_boys.test_men_from_boys.
MenFromBoysTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing men_from_boys function
-
test_men_from_boys
()[source]¶ Testing men_from_boys function with various test inputs
Scenario Now that the competition gets tough it will Sort out the men from the boys .
Men are the Even numbers and Boys are the odd !alt !alt
Task Given an array/list [] of n integers , Separate The even numbers from the odds , or Separate the men from the boys !alt !alt
Notes Return an array/list where Even numbers come first then odds. Since , Men are stronger than Boys , Then Even numbers in ascending order While odds in descending. :return:
-