How to Solve '796 Rotate String' on LeetCode? - Javascript

preview_player
Показать описание
Do you need more help with coding?
════════════════════════════

How to Solve "796 Rotate String" on LeetCode?

Problem: #796 Rotate String
Language: #Javascript
Difficulty: Easy

Strategy: Check index of B from A
Time Complexity:O(n)
Space Complexity: O(n)

This is one possible solution and may not be the most optimal one.

Pseudo Code:
1. Condition if A and B are different lengths.
a. Return false.
2. Add A to A.
a. See if B is an index of A.
b. Return true or false.

GitHub Repo:

Let's Connect 💯:
════════════════════════════
Рекомендации по теме
Комментарии
Автор

Thanks david for the solutions you are providing, I'm learning Dsa in javascript majorly from your playlists

samuelrodrigues-
visit shbcf.ru