Skip to content

File Name: template.py ```python from utilities.testUtils import solution_title, print_and_assert_new, getTestResult from utilities.commonUtils import timeComplexity, spaceComplexity

print('\n >>> 00. ') print(''' Desc goes here ''')</p> <p>class ProblemName(object): def quick(self, s): pass def brute_force(self, s): pass def sub_optimal(self, s): pass def optimal(self, s): pass</p> <h1 id="parameters-and-expected-values">Parameters and Expected Values.</h1> <p>param1 = 'param1' param11 = 'param11' expect1 = 'expect1'</p> <p>param2 = 'param2' param22 = 'param22' expect2 = 'expect2'</p> <p>param3 = 'param3' param33 = 'param33' expect3 = 'expect3'</p> <p>solution = ProblemName() solution_title('ProblemName - Quick One') print_and_assert_new(solution.quick, param1, param11, expected=expect1) print_and_assert_new(solution.quick, param2, param22, expected=expect2) print_and_assert_new(solution.quick, param3, param33, expected=expect3) getTestResult('ProblemName - Quick One')</p> <p>timeComplexity('O(n)', 'desc_goes_here') spaceComplexity('O(n)', 'desc_goes_here')</p> <p>solution_title('ProblemName - Brute Force') print_and_assert_new(solution.brute_force, param1, param11, expected=expect1) print_and_assert_new(solution.brute_force, param2, param22, expected=expect2) print_and_assert_new(solution.brute_force, param3, param33, expected=expect3) getTestResult('ProblemName - Brute Force')</p> <p>timeComplexity('O(n)', 'desc_goes_here') spaceComplexity('O(n)', 'desc_goes_here')</p> <p>solution_title('ProblemName - Sub Optimal') print_and_assert_new(solution.sub_optimal, param1, param11, expected=expect1) print_and_assert_new(solution.sub_optimal, param2, param22, expected=expect2) print_and_assert_new(solution.sub_optimal, param3, param33, expected=expect3) getTestResult('ProblemName - Sub Optimal')</p> <p>timeComplexity('O(n)', 'desc_goes_here') spaceComplexity('O(n)', 'desc_goes_here')</p> <p>solution_title('ProblemName - Optimal') print_and_assert_new(solution.optimal, param1, param11, expected=expect1) print_and_assert_new(solution.optimal, param2, param22, expected=expect2) print_and_assert_new(solution.optimal, param3, param33, expected=expect3) getTestResult('ProblemName - Optimal')</p> <p>timeComplexity('O(n + m)', 'desc_goes_here') spaceComplexity('O(n + m)', 'desc_goes_here')```</p> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> </main> <footer class="md-footer"> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-copyright"> Made with <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> Material for MkDocs </a> </div> </div> </div> </footer> </div> <div class="md-dialog" data-md-component="dialog"> <div class="md-dialog__inner md-typeset"></div> </div> <script id="__config" type="application/json">{"base": "../..", "features": ["navigation.sections", "navigation.footer", "search.suggest", "search.highlight", "search.share", "content.code.copy"], "search": "../../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script> <script src="../../assets/javascripts/bundle.83f73b43.min.js"></script> </body> </html>