This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def solution(moves): | |
| x_coord = 0 | |
| y_coord = 0 | |
| right_turns = 0 | |
| n = len(moves) | |
| horizontal = '><' | |
| vertical = '^v' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def solution(message, K): | |
| if len(message) <= K: | |
| return message | |
| all_words = message.split(" ") | |
| notification = [] | |
| count = 0 | |
| for current_word in all_words: | |
| word_len = len(current_word) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def solution(T): | |
| N = len(T) | |
| current_time = 0 | |
| result = 0 | |
| queue = [(index, T[index]) for index in range(N)] | |
| while queue: | |
| running_len = len(queue) | |
| while running_len: | |
| index, element = queue.pop(0) | |
| current_time += 1 |