<problem>
Write a function `search(x: int, seq: List[int]) -> int` that returns the index of the first occurrence of `x` in `seq`. If `x` is not in `seq`, return the index where `x` should be inserted to keep `seq` sorted. Assume that `seq` is sorted in ascending order.
## Example Cases:
```
search(5, [-1, 5, 8, 10, 12]) => 1
search(-2, [-1, 57, 65]) => 0
search(0, [-120, 60, 78, 100]) => 1
search(77, [-100, -50, 5, 44, 66, 76, 99]) => 6
search(55, [-99, -2, 0]) => 3
```
</problem>
<bug_code>
1. def search(x, seq):
2.  for i in range(len(seq)):
3.    if x <= seq[i]:
4.      return i
</bug_code>
<bug_desc>
The function returns `None` when `x` is greater than all of the elements in `seq` instead of returning the index indicating that `x` should be inserted at the end of the array.
</bug_desc>
<bug_fixes>
Insert a line following line 4, with one indentation containing `return len(seq)` 
</bug_fixes>
<unit_tests>
assert search(5, [-1, 5, 8, 10, 12]) == 1
assert search(-2, [-1, 57, 65]) == 0
assert search(0, [-120, 60, 78, 100]) == 1
assert search(77, [-100, -50, 5, 44, 66, 76, 99] ) == 6
assert search(55, [-99, -2, 0]) == 3
</unit_tests>
<stu_desc>

</stu_desc>
<dialogue>
User: Hi! I seem to be having some issues with this function I am trying to implement. It sometimes returns `None` instead of an output. 
Assistant: Can you walk me through how your function handles some simple examples? For example, `search(5, [-1, 5, 8, 10, 12])`.
	<alt>Do you notice a pattern with the cases that produce `None`?
	<alt>When do you notice `None` as the output?
	<alt>What inputs have you tried? When do you get `None`?
	<alt>It seems that your function may be returning nothing in certain cases. Can you think of a case where this might happen?
User: For that example, I get an output of 1. I first iterate through the elements in the list and check when the 5 is less than or equal to the current element, which happens at index 1. 
	<alt>This just gives an output of 1
Assistant: I see. What happens when you have a larger `x` value? Try `search(20, [-1, 5, 8, 10, 12])`.
	<alt>I see. What about when your `x` is not less than or equal to any elements?
	<alt>That seems right. How do you deal with negative numbers and numbers greater than all the list elements?
	<alt>Good. Is there a case where your function might not return anything?
User: For that, my code seems to return `None`. I use the same procedure and iterate through the list element. Oh, I see. Since 20 is greater than all the current list elements, I never get to the `return`
Assistant: It looks like you just need to handle that other case then. What's a good answer to return when `x` is greater than all the existing elements?
	<alt>Where would you want to insert an element that is larger than all the current ones?
	<alt>What's a good place to insert 20 in the example I gave you?
User: I think I should put it at the end of the list. I'll update the code and see if it works.
<code>
 def search(x, seq):
  for i in range(len(seq)):
    if x <= seq[i]:
      return i
  return len(seq)

</code>
Assistant: Looks like it works! Let me know if you need more help
</dialogue>