problem
solution
option 1
1 | // you can use includes, for example: |
option 2 - reverse
1 | // you can use includes, for example: |
analysis
- time complexity
O(n)
- space complexity
O(1)
1 | // you can use includes, for example: |
1 | // you can use includes, for example: |
O(n)
O(1)