I hereby claim:
- I am nickczj on github.
- I am nczj (https://keybase.io/nczj) on keybase.
- I have a public key ASBUkkou6aZ3xKxfg2Ww-Zq0Jgs9FnPWtbjJHjqvLW3pQAo
To claim this, I am signing this object:
blueprint: | |
name: ZHA - Aqara Wireless Remote Switch (Double Rocker) | |
description: Automate your Xiaomi Aqara Wireless Remote Switch (Double Rocker) using ZHA events. | |
domain: automation | |
input: | |
aqara_h1_switch: | |
name: Select the Aqara Wireless Remote Switch (Double Rocker) | |
description: Aqara Wireless Remote Switch (Double Rocker) | |
selector: | |
device: |
blueprint: | |
name: Aqara Magic Cube | |
description: Control anything using Aqara Magic Cube. | |
domain: automation | |
input: | |
remote: | |
name: Magic Cube | |
description: Select the Aqara Magic Cube device | |
selector: | |
device: |
""" | |
An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9, 7] (elements are shifted right by one index and 6 is moved to the first place). | |
The goal is to rotate array A K times; that is, each element of A will be shifted to the right K times. | |
Write a function: | |
def solution(A, K) |
import math | |
""" | |
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. | |
For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps. | |
Write a function: |
I hereby claim:
To claim this, I am signing this object:
// Problem Description | |
//https://docs.google.com/document/d/1-ipuufYNAe94DySnxkw-nOF6iNezTjvRJanNsFLvLUc/edit?usp=sharing | |
import java.util.ArrayList; | |
public class BabyName { | |
ArrayList babyNameList = new ArrayList(); | |
ArrayList genderList = new ArrayList(); | |
import unittest | |
def find_anagrams(list_of_strings, word): | |
# your implementation here | |
anagrams = [] | |
for i in list_of_strings: | |
if ' '.join(sorted(word)) == ' '.join(sorted(i)): | |
anagrams.append(i) | |
return anagrams | |
import unittest, string | |
def adjacent_digits_product(numb_str, digits_count): | |
cases = len(numb_str) - digits_count | |
biggest = 1 | |
for i in range(cases): | |
product = 1 | |
for e in range(i, i+digits_count): | |
product *= int(numb_str[e]) |
### Assignment ### | |
# | |
# Your assignment is to implement the | |
# following function: `find_next_prime`. | |
# As the name states, given the number `n` the | |
# function should return the next closest prime. | |
# | |
# Examples: | |
# * `find_next_prime(6)` should return 7. | |
# * `find_next_prime(10)` should return 11. |