forked from codepath/compsci_guides
-
Notifications
You must be signed in to change notification settings - Fork 0
List Concatenation
Jessica Sang edited this page Sep 14, 2024
·
1 revision
Unit 1 Session 1 (Click for link to problem statements)
Understand what the interviewer is asking for by using test cases and questions about the problem.
- Can I assume the inputs will always be lists?
- Yes.
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Write a function that takes two lists as inputs and combines them into one list.
def concatenate_list(nums):
return nums * 2
OR
def concatenate_list(nums):
return nums + nums