def solve(task): """ Calculate number of nice strings Args: task (str): agagasdgsdg \n aasdfasgsdg \n ... (without spaces) Returns: int: Number of nice strings """ data = process_data(task) return sum(is_nice(line) for line in data)
def test_returns_correct_result(self): self.assertEqual(process_data('ab\ncd\n'), ['ab', 'cd']) self.assertEqual(process_data('ab'), ['ab'])