<commit_before>"""
 Ref: https://www.hackerrank.com/challenges/misere-nim-1
 Wikipedia: https://en.wikipedia.org/wiki/Nim
 Solution hint: http://mathoverflow.net/questions/71802/analysis-of-misere-nim
"""
import unittest


def misere_nim(piles):
    pass


class MyTestCases(unittest.TestCase):
    def test_misere_nim(self):
        pass<commit_msg>Feat: Completed misere min algorithm problem<commit_after>"""
 Ref: https://www.hackerrank.com/challenges/misere-nim-1
 Wikipedia: https://en.wikipedia.org/wiki/Nim
 Solution hint: http://mathoverflow.net/questions/71802/analysis-of-misere-nim
"""
import unittest


def misere_nim(piles):
    xor_piles = 0
    for pile in piles:
        xor_piles ^= pile
    if xor_piles == 0:
        if max(piles) > 1:
            return 'Second'
    elif xor_piles == 1:
        if max(piles) <= 1:
            return 'Second'
    return 'First'


class MyTestCases(unittest.TestCase):
    def test_misere_nim(self):
        piles = [1, 1]
        self.assertEqual(misere_nim(piles), 'First')
        piles = [2, 1, 3]
        self.assertEqual(misere_nim(piles), 'Second')
{'fraction_non_alphanumeric': 0.13243243243243244, 'fraction_numerical': 0.01981981981981982, 'mean_word_length': 3.130111524163569, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4596674', 'n_tokens_mistral': 419, 'n_tokens_neox': 404, 'n_words': 75}