2021-01-27から1日間の記事一覧
Letcode problems 1. Two Sum # exactly one solution Input: nums = [2,7,11,15], target = 9 Output: [0,1] Output: Because nums[0] + nums[1] == 9, we return [0, 1].class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: # …
HackerRank Interview Preparation Kit Type : Array Arrays: Left RotationExplanation When we perform left rotations, the array undergoes the following sequence of changes:Sample Input 5 4 1 2 3 4 5Sample Output 5 1 2 3 4 Solution def rotLeft…