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
| class Solution(object): | |
| def findDuplicate(self, nums): | |
| """ | |
| :type nums: List[int] | |
| :rtype: int | |
| """ | |
| for i in range(len(nums)): | |
| if nums[abs(nums[i])] < 0: | |
| return abs(nums[i]) | |
| nums[abs(nums[i])] = -nums[abs(nums[i])] |
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
| package com.example.util | |
| import com.amazonaws.regions.Regions | |
| import com.amazonaws.services.kms.model.DecryptRequest | |
| import com.amazonaws.services.kms.AWSKMSClientBuilder; | |
| import com.amazonaws.services.kms.model.EncryptRequest; | |
| import java.nio.ByteBuffer | |
| import java.nio.charset.StandardCharsets | |
| import java.util.* |
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
| import base64 | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| import logging | |
| AWS_REGION = 'us-east-1' | |
| kms_client = boto3.client("kms", region_name=AWS_REGION) | |
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
| import base64 | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| AWS_REGION = 'us-east-1' | |
| kms_client = boto3.client("kms", region_name=AWS_REGION) | |
| def encrypt(secret, key_id): | |
| try: |