<jupyter_start><jupyter_text>This notebook was prepared by [<NAME>](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).  Challenge Notebook  Problem: Find the longest increasing subsequence.* [Constraints](Constraints)* [Test Cases](Test-Cases)* [Algorithm](Algorithm)* [Code](Code)* [Unit Test](Unit-Test)* [Solution Notebook](Solution-Notebook)  Constraints* Are duplicates possible?    * Yes* Can we assume the inputs are integers?    * Yes* Can we assume the inputs are valid?    * No* Do we expect the result to be an array of the longest increasing subsequence?    * Yes* Can we assume this fits memory?    * Yes  Test Cases* None -> Exception* [] -> []* [3, 4, -1, 0, 6, 2, 3] -> [-1, 0, 2, 3]  AlgorithmRefer to the [Solution Notebook]().  If you are stuck and need a hint, the solution notebook's algorithm discussion might be a good place to start.  Code<jupyter_code>class Subsequence(object):

    def longest_inc_subseq(self, seq):
        # TODO: Implement me
        pass<jupyter_output><empty_output><jupyter_text>Unit Test **The following unit test is expected to fail until you solve the challenge.**<jupyter_code># %load test_longest_increasing_subseq.py
from nose.tools import assert_equal, assert_raises


class TestLongestIncreasingSubseq(object):

    def test_longest_increasing_subseq(self):
        subseq = Subsequence()
        assert_raises(TypeError, subseq.longest_inc_subseq, None)
        assert_equal(subseq.longest_inc_subseq([]), [])
        seq = [3, 4, -1, 0, 6, 2, 3]
        expected = [-1, 0, 2, 3]
        assert_equal(subseq.longest_inc_subseq(seq), expected)
        print('Success: test_longest_increasing_subseq')


def main():
    test = TestLongestIncreasingSubseq()
    test.test_longest_increasing_subseq()


if __name__ == '__main__':
    main()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11314824515453117, 'fraction_numerical': 0.011524358302776323, 'mean_word_length': 4.4415954415954415, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '36543', 'license': 'Apache-2.0', 'n_tokens_mistral': 627, 'n_tokens_neox': 581, 'n_words': 179, 'path': 'recursion_dynamic/longest_inc_subseq/longest_inc_subseq_challenge.ipynb', 'repo_name': 'sophomore99/PythonInterective', 'size': '1915'}